helm / helm/helm

incorrect arg parsing with helm plugins

Open
#13,686 16 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Go
Stars
30.2k
Forks
7.8k
Avg merge
20h 58m
Merged PRs (30d)
36

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](https://github.com/jkroepke/helm-arg-demo-plugin/blob/main/plugin.yaml) to indicate the issue:

```shell
# 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.