[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:
co-authored by
Andres Martinez Gotor
parent
33ff08215c
commit
0315b911ef
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user