mirror of
https://github.com/helm/helm.git
synced 2026-04-24 07:37:48 -04:00
Merge pull request #31416 from MarcAntoineRaymond/dev-v3
[v3 backport] Fix `helm pull` untar dir check with repo urls
This commit is contained in:
commit
8b53467dd9
2 changed files with 15 additions and 2 deletions
|
|
@ -147,6 +147,18 @@ func TestPullCmd(t *testing.T) {
|
|||
failExpect: "Failed to fetch chart version",
|
||||
wantError: true,
|
||||
},
|
||||
{
|
||||
name: "Chart fetch using repo URL with untardir",
|
||||
args: "signtest --version=0.1.0 --untar --untardir repo-url-test --repo " + srv.URL(),
|
||||
expectFile: "./signtest",
|
||||
expectDir: true,
|
||||
},
|
||||
{
|
||||
name: "Chart fetch using repo URL with untardir and previous pull",
|
||||
args: "signtest --version=0.1.0 --untar --untardir repo-url-test --repo " + srv.URL(),
|
||||
failExpect: "failed to untar",
|
||||
wantError: true,
|
||||
},
|
||||
{
|
||||
name: "Fetch OCI Chart",
|
||||
args: fmt.Sprintf("oci://%s/u/ocitestuser/oci-dependent-chart --version 0.1.0", ociSrv.RegistryURL),
|
||||
|
|
|
|||
|
|
@ -121,15 +121,16 @@ func (p *Pull) Run(chartRef string) (string, error) {
|
|||
defer os.RemoveAll(dest)
|
||||
}
|
||||
|
||||
downloadSourceRef := chartRef
|
||||
if p.RepoURL != "" {
|
||||
chartURL, err := repo.FindChartInAuthAndTLSAndPassRepoURL(p.RepoURL, p.Username, p.Password, chartRef, p.Version, p.CertFile, p.KeyFile, p.CaFile, p.InsecureSkipTLSverify, p.PassCredentialsAll, getter.All(p.Settings))
|
||||
if err != nil {
|
||||
return out.String(), err
|
||||
}
|
||||
chartRef = chartURL
|
||||
downloadSourceRef = chartURL
|
||||
}
|
||||
|
||||
saved, v, err := c.DownloadTo(chartRef, p.Version, dest)
|
||||
saved, v, err := c.DownloadTo(downloadSourceRef, p.Version, dest)
|
||||
if err != nil {
|
||||
return out.String(), err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue