polaris
polaris copied to clipboard
Error: release name: invalid release name
What happened?
Comming from docs https://polaris.docs.fairwinds.com/infrastructure-as-code/#running-in-a-ci-pipeline
I executed
polaris audit --helm-chart ./charts/sealed-secrets --helm-values ./values.yaml
and run into an error:
ERRO[0000] Error: release name "./charts/sealed-secrets": invalid release name, must match regex ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ and the length must not be longer than 53
INFO[0000] Couldn't process helm chart: exit status 1
What did you expect to happen?
A successful audit run.
How can we reproduce this?
Running
polaris audit \
--helm-chart ./deploy/chart \
--helm-values ./deploy/chart/values.yml
Version
7.0.1
Search
- [X] I did search for other open and closed issues before opening this.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Additional context
No response
Current workaround:
cd charts
polaris audit --helm-chart sealed-secrets --helm-values ../values.yaml
What is not working:
cd charts
polaris audit --helm-chart ./sealed-secrets --helm-values ../values.yaml
cd charts/sealed-secrets
polaris audit --helm-chart . --helm-values ../values.yaml
Thanks for the report! Looks like this is the offending line of code: https://github.com/FairwindsOps/polaris/blob/78838a606dc1fe790d1308cc7d2cd80f2bdfd92e/cmd/polaris/audit.go#L145
We'll just need to sanitize the chart name before passing it to helm template
Maybe should we allow to pass this as a flag? Like namespace?
Another workaround without cd
(We use loop in our test and we don't want to mess with cd
there :P):
helm template charts/sealed-secrets --values values.yaml > ci-output.yaml
polaris audit --audit-path ci-output.yaml --format=pretty
This seems to have been fixed in the latest versions of Polaris, as we are using the --generate-name
flag now.