From 2a734c2040f9136e60f482bc099b360074c8aa02 Mon Sep 17 00:00:00 2001 From: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com> Date: Tue, 5 Jan 2021 14:26:48 +0100 Subject: [PATCH] fall back to any architecture when getting plugin's checksum #30034 (#30035) * fall back to any architecture when getting plugin's checksum * Update pkg/cmd/grafana-cli/commands/install_command.go Co-authored-by: Arve Knudsen * remove typo Co-authored-by: Arve Knudsen --- pkg/cmd/grafana-cli/commands/install_command.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/grafana-cli/commands/install_command.go b/pkg/cmd/grafana-cli/commands/install_command.go index e99952b5210..77c39884c95 100644 --- a/pkg/cmd/grafana-cli/commands/install_command.go +++ b/pkg/cmd/grafana-cli/commands/install_command.go @@ -97,7 +97,11 @@ func InstallPlugin(pluginName, version string, c utils.CommandLine, client utils // Plugins which are downloaded just as sourcecode zipball from github do not have checksum if v.Arch != nil { - checksum = v.Arch[osAndArchString()].SHA256 + archMeta, exists := v.Arch[osAndArchString()] + if !exists { + archMeta = v.Arch["any"] + } + checksum = archMeta.SHA256 } }