Skip to content

Commit 8e8f883

Browse files
authored
Add support for --insecure-skip-tls-verify (databus23#462)
I believe helm-diff should eventually support all the helm-template flags including connection-related ones, so that helm-diff can be used in place where helm-template or helm-upgrade-dry-run to provide diff/dry-run functionality to existing script/program/etc. This adds support for --insecure-skip-tls which is used to disable server verification on chart download.
1 parent 042d66c commit 8e8f883

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cmd/helm3.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) {
105105
for _, arg := range d.postRendererArgs {
106106
flags = append(flags, "--post-renderer-args", arg)
107107
}
108+
if d.insecureSkipTLSVerify {
109+
flags = append(flags, "--insecure-skip-tls-verify")
110+
}
108111
// Helm automatically enable --reuse-values when there's no --set, --set-string, --set-values, --set-file present.
109112
// Let's simulate that in helm-diff.
110113
// See https://medium.com/@kcatstack/understand-helm-upgrade-flags-reset-values-reuse-values-6e58ac8f127e

cmd/upgrade.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type diffCmd struct {
5252
includeTests bool
5353
postRenderer string
5454
postRendererArgs []string
55+
insecureSkipTLSVerify bool
5556
install bool
5657
normalizeManifests bool
5758
threeWayMerge bool
@@ -197,6 +198,7 @@ func newChartCommand() *cobra.Command {
197198
f.BoolVar(&diff.dryRun, "dry-run", false, "disables cluster access and show diff as if it was install. Implies --install, --reset-values, and --disable-validation")
198199
f.StringVar(&diff.postRenderer, "post-renderer", "", "the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path")
199200
f.StringArrayVar(&diff.postRendererArgs, "post-renderer-args", []string{}, "an argument to the post-renderer (can specify multiple)")
201+
f.BoolVar(&diff.insecureSkipTLSVerify, "insecure-skip-tls-verify", false, "skip tls certificate checks for the chart download")
200202
f.BoolVar(&diff.normalizeManifests, "normalize-manifests", false, "normalize manifests before running diff to exclude style differences from the output")
201203

202204
AddDiffOptions(f, &diff.Options)

0 commit comments

Comments
 (0)