|
|
|
@ -49,7 +49,7 @@ func (pm *PluginManager) checkForUpdates() { |
|
|
|
|
pluginSlugs := pm.getAllExternalPluginSlugs() |
|
|
|
|
resp, err := httpClient.Get("https://grafana.com/api/plugins/versioncheck?slugIn=" + pluginSlugs + "&grafanaVersion=" + setting.BuildVersion) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Tracef("Failed to get plugins repo from grafana.com, %v", err.Error()) |
|
|
|
|
log.Debug("Failed to get plugins repo from grafana.com", "error", err.Error()) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
defer func() { |
|
|
|
@ -60,14 +60,14 @@ func (pm *PluginManager) checkForUpdates() { |
|
|
|
|
|
|
|
|
|
body, err := ioutil.ReadAll(resp.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Tracef("Update check failed, reading response from grafana.com, %v", err.Error()) |
|
|
|
|
log.Debug("Update check failed, reading response from grafana.com", "error", err.Error()) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
gNetPlugins := []grafanaNetPlugin{} |
|
|
|
|
err = json.Unmarshal(body, &gNetPlugins) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Tracef("Failed to unmarshal plugin repo, reading response from grafana.com, %v", err.Error()) |
|
|
|
|
log.Debug("Failed to unmarshal plugin repo, reading response from grafana.com", "error", err.Error()) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -90,7 +90,7 @@ func (pm *PluginManager) checkForUpdates() { |
|
|
|
|
|
|
|
|
|
resp2, err := httpClient.Get("https://raw.githubusercontent.com/grafana/grafana/main/latest.json") |
|
|
|
|
if err != nil { |
|
|
|
|
log.Tracef("Failed to get latest.json repo from github.com: %v", err.Error()) |
|
|
|
|
log.Debug("Failed to get latest.json repo from github.com", "error", err.Error()) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
defer func() { |
|
|
|
@ -100,14 +100,14 @@ func (pm *PluginManager) checkForUpdates() { |
|
|
|
|
}() |
|
|
|
|
body, err = ioutil.ReadAll(resp2.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Tracef("Update check failed, reading response from github.com, %v", err.Error()) |
|
|
|
|
log.Debug("Update check failed, reading response from github.com", "error", err.Error()) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var latest gitHubLatest |
|
|
|
|
err = json.Unmarshal(body, &latest) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Tracef("Failed to unmarshal github.com latest, reading response from github.com: %v", err.Error()) |
|
|
|
|
log.Debug("Failed to unmarshal github.com latest, reading response from github.com", "error", err.Error()) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|