Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm plugins are no longer installed #44

Closed
Angelin01 opened this issue Jan 17, 2023 · 3 comments · Fixed by #47
Closed

Helm plugins are no longer installed #44

Angelin01 opened this issue Jan 17, 2023 · 3 comments · Fixed by #47

Comments

@Angelin01
Copy link
Contributor

Helm plugins are installed to ~/.local/share/helm/plugins, however PR #42 seems to delete /root/.local, deleting the plugins along with it:

> docker run --rm -ti alpine/k8s:1.23.15 helm unittest
Error: unknown command "unittest" for "helm"
Run 'helm --help' for usage.
> docker run --rm -ti alpine/k8s:1.23.14 helm unittest
Error: requires at least 1 arg(s), only received 0
Usage:
  unittest [flags] CHART [...]

Flags:
      --color                  enforce printing colored output even stdout is not a tty. Set to false to disable color
  -d, --debug                  enable debug logging
  -q, --failfast               direct quit testing, when a test is failed
  -f, --file stringArray       glob paths of test files location, default to tests/*_test.yaml (default [tests/*_test.yaml])
  -3, --helm3                  parse helm charts as helm3 charts
  -h, --help                   help for unittest
  -o, --output-file string     output-file the file where testresults are written in JUnit format, defaults no output is written to file
  -t, --output-type string     output-type the file-format where testresults are written in, accepted types are (JUnit, NUnit, XUnit) (default "XUnit")
      --strict                 strict parse the testsuites
  -u, --update-snapshot        update the snapshot cached if needed, make sure you review the change before update
  -v, --values stringArray     absolute or glob paths of values files location, default no values files
  -s, --with-subchart charts   include tests of the subcharts within charts folder (default true)

requires at least 1 arg(s), only received 0
Error: plugin "unittest" exited with error

You can easily find the location using find:

> docker run --rm -ti alpine/k8s:1.23.14 find / -name 'unittest'
/usr/lib/python3.10/unittest
/root/.cache/helm/plugins/https-github.com-quintush-helm-unittest/pkg/unittest
/root/.local/share/helm/plugins/helm-unittest/pkg/unittest
@johnswarbrick-napier
Copy link

Seems the deletion was too aggressive.

#40 was only intended to remove the *.key files as their presence is being flagged by commercial security scanners as a mid-high severity vulnerability.

Of course it can be argued the presence of .key files isn't a security vulnerability at all, but their presence creates a lot of noise and requires exemptions so it's easier to just get rid of them as they are not required post-build.

Perhaps the deletion could be modified to either explicit paths:

rm -f /root/.local/share/helm/plugins/helm-push/testdata/tls/server.key
rm -f /root/.local/share/helm/plugins/helm-push/testdata/tls/client.key
rm -f /root/.cache/helm/plugins/https-github.com-chartmuseum-helm-push/testdata/tls/client.key
rm -f /root/.cache/helm/plugins/https-github.com-chartmuseum-helm-push/testdata/tls/server.key

Or a search:

find /root/ -name ".key" -exec rm -f {} \;

@ozbillwang
Copy link
Collaborator

ozbillwang commented Jan 18, 2023

ok, so let's rollback the change and only delete the keys after install plugin helm-push

@ozbillwang
Copy link
Collaborator

ozbillwang commented Jan 18, 2023

will raise a request to helm push repo owner, to confirm if they can remove the folder testdata after its plugin installed.

seems there are more keys to be cleaned

find . |grep key
./helm-push/testdata/pgp/helm-test-key.pub
./helm-push/testdata/pgp/helm-test-key.secret

updates

request is raised: chartmuseum/helm-push#171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants