Skip to content

Commit

Permalink
add "--insecure-skip-tls-verify" on helm pull when Creds.InsecureSkip…
Browse files Browse the repository at this point in the history
…Verify is set to true
  • Loading branch information
Pieter van der Meer authored and Pieter van der Meer committed Jun 11, 2021
1 parent 6f95950 commit 6071d8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions util/helm/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ func Test_nativeHelmChart_ExtractChart(t *testing.T) {
assert.True(t, info.IsDir())
}

func Test_nativeHelmChart_ExtractChart_insecure(t *testing.T) {
client := NewClient("https://argoproj.github.io/argo-helm", Creds{InsecureSkipVerify: true}, false)
path, closer, err := client.ExtractChart("argo-cd", "0.7.1")
assert.NoError(t, err)
defer io.Close(closer)
info, err := os.Stat(path)
assert.NoError(t, err)
assert.True(t, info.IsDir())
}

func Test_normalizeChartName(t *testing.T) {
t.Run("Test non-slashed name", func(t *testing.T) {
n := normalizeChartName("mychart")
Expand Down
3 changes: 3 additions & 0 deletions util/helm/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ func (c *Cmd) Fetch(repo, chartName, version, destination string, creds Creds) (
if creds.Password != "" {
args = append(args, "--password", creds.Password)
}
if creds.InsecureSkipVerify {
args = append(args, "--insecure-skip-tls-verify")
}

args = append(args, "--repo", repo, chartName)

Expand Down

0 comments on commit 6071d8f

Please sign in to comment.