helm/helm

incorrect arg parsing with helm plugins

Open

#13,686 opened on Jan 29, 2025

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Go (7,602 forks)batch import
bughelp wanted

Repository metrics

Stars
 (29,815 stars)
PR merge metrics
 (Avg merge 40d 17h) (48 merged PRs in 30d)

Description

Hi,

a user of the helm-secrets plugin reports an issue with --kube-insecure-skip-tls-verify since helm 3.16.

https://github.com/jkroepke/helm-secrets/issues/492

It turn out that this boolean flag was ignored before (https://github.com/helm/helm/pull/12856). I expect that the internal behavior was broken before.

From my point of view, if --kube-insecure-skip-tls-verify is set, the value after the flag is parsed wrongly and lead to unexpected behavior.

Here is a simple plugin to indicate the issue:

# helm plugin install https://github.com/jkroepke/helm-arg-demo-plugin
Installed plugin: arg-demo
# helm arg-demo
Hello World
# helm arg-demo --kube-insecure-skip-tls-verify
Hello World
# helm arg-demo --kube-insecure-skip-tls-verify --version 1.0.3
Error: unknown flag: --version
# helm --debug arg-demo --kube-insecure-skip-tls-verify=true --version 1.0.3
Hello World --version 1.0.3
# helm --debug arg-demo --kube-insecure-skip-tls-verify true --version 1.0.3
Hello World --version 1.0.3

A workaround exists: A explicit boolean value must be set after the flag.

Contributor guide