fix: ensure development versions of charts can be used across helmfile commands (#1865)

Signed-off-by: purpleclay <purpleclaygh@gmail.com>
This commit is contained in:
Purple Clay
2025-01-13 20:55:23 +08:00
committed by GitHub
parent 2e21e2fa0b
commit 2333f093c1
5 changed files with 65 additions and 37 deletions
+2 -2
View File
@@ -519,8 +519,8 @@ func (helm *execer) ChartPull(chart string, path string, flags ...string) error
if helmVersionConstraint.Check(helm.version) {
// in the 3.7.0 version, the chart pull has been replaced with helm pull
// https://github.com/helm/helm/releases/tag/v3.7.0
ociChartURL, ociChartTag := resolveOciChart(chart)
helmArgs = []string{"pull", ociChartURL, "--version", ociChartTag, "--destination", path, "--untar"}
ociChartURL, _ := resolveOciChart(chart)
helmArgs = []string{"pull", ociChartURL, "--destination", path, "--untar"}
helmArgs = append(helmArgs, flags...)
} else {
helmArgs = []string{"chart", "pull", chart}
+6 -6
View File
@@ -826,20 +826,20 @@ exec: helm --kubeconfig config --kube-context dev chart pull chart
helmVersion: "v3.10.0",
chartName: "repo/helm-charts:0.14.0",
chartPath: "path1",
chartFlags: []string{"--untardir", "/tmp/dir"},
chartFlags: []string{"--untardir", "/tmp/dir", "--version", "0.14.0"},
listResult: `Pulling repo/helm-charts:0.14.0
exec: helm --kubeconfig config --kube-context dev pull oci://repo/helm-charts --version 0.14.0 --destination path1 --untar --untardir /tmp/dir
exec: helm --kubeconfig config --kube-context dev pull oci://repo/helm-charts --destination path1 --untar --untardir /tmp/dir --version 0.14.0
`,
},
{
name: "more then v3.7.0 with rc",
helmBin: "helm",
helmVersion: "v3.14.0-rc.1+g69dcc92",
chartName: "repo/helm-charts:0.14.0",
chartName: "repo/helm-charts",
chartPath: "path1",
chartFlags: []string{"--untardir", "/tmp/dir"},
listResult: `Pulling repo/helm-charts:0.14.0
exec: helm --kubeconfig config --kube-context dev pull oci://repo/helm-charts --version 0.14.0 --destination path1 --untar --untardir /tmp/dir
chartFlags: []string{"--untardir", "/tmp/dir", "--devel"},
listResult: `Pulling repo/helm-charts
exec: helm --kubeconfig config --kube-context dev pull oci://repo/helm-charts --destination path1 --untar --untardir /tmp/dir --devel
`,
},
}