[v9.5.x] Catalog: Show install error with incompatible version (#66817)

Catalog: Show install error with incompatible version (#65059)

(cherry picked from commit 98778289cb)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2023-04-19 10:51:07 +02:00
committed by GitHub
co-authored by Andres Martinez Gotor
parent 33ff08215c
commit 0315b911ef
8 changed files with 54 additions and 13 deletions
+9
View File
@@ -53,6 +53,15 @@ func (e Response4xxError) Error() string {
return fmt.Sprintf("%d", e.StatusCode)
}
type ErrArcNotFound struct {
PluginID string
SystemInfo string
}
func (e ErrArcNotFound) Error() string {
return fmt.Sprintf("%s is not compatible with your system architecture: %s", e.PluginID, e.SystemInfo)
}
type ErrVersionUnsupported struct {
PluginID string
RequestedVersion string
+3 -4
View File
@@ -111,10 +111,9 @@ func (m *Manager) selectVersion(plugin *Plugin, version string, compatOpts Compa
var ver Version
latestForArch := latestSupportedVersion(plugin, compatOpts)
if latestForArch == nil {
return nil, ErrVersionUnsupported{
PluginID: plugin.ID,
RequestedVersion: version,
SystemInfo: compatOpts.String(),
return nil, ErrArcNotFound{
PluginID: plugin.ID,
SystemInfo: compatOpts.OSAndArch(),
}
}