From 84edcaae34363d54adc069c893d5a9bf806ade63 Mon Sep 17 00:00:00 2001 From: Johnny-ZTSD <1125418540@qq.com> Date: Fri, 20 Dec 2024 19:01:23 +0800 Subject: [PATCH] [fix] download.go : Fail to gemix cluster install ... cause that grafana:7.5.17 's download url is changed. throw exception: "Error: receiving status of 404 for url: https://dl.grafana.com/oss/release/grafana-enterprise-7.5.17.linux-amd64.tar.gz" #67 https://github.com/openGemini/gemix/issues/67 --- pkg/cluster/operation/download.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/operation/download.go b/pkg/cluster/operation/download.go index 4a99c85..bc53d92 100644 --- a/pkg/cluster/operation/download.go +++ b/pkg/cluster/operation/download.go @@ -49,7 +49,13 @@ func Download(prefix, component, nodeOS, arch, version string) error { arch = "amd64" } fileName = fmt.Sprintf("%s-enterprise-%s.%s-%s.tar.gz", component, ver.GrafanaVersion, nodeOS, arch) - componentUrl = strings.Join([]string{"https://dl.grafana.com/oss/release", fileName}, "/") + // FIX for : https://github.com/openGemini/gemix/issues/67 + grafanaBaseUrlEnv := os.Getenv("GRAFANA_BASE_URL"); + if grafanaBaseUrlEnv == "" { + grafanaBaseUrlEnv = "https://dl.grafana.com/enterprise/release"; //"https://dl.grafana.com/oss/release" is Deprecated + } + //componentUrl = strings.Join([]string{"https://dl.grafana.com/oss/release", fileName}, "/") + componentUrl = strings.Join([]string{ grafanaBaseUrlEnv, fileName}, "/") } dstPath := spec.ProfilePath(spec.OpenGeminiPackageCacheDir, fileName) if err := os.MkdirAll(spec.ProfilePath(spec.OpenGeminiPackageCacheDir), 0750); err != nil {