polaris icon indicating copy to clipboard operation
polaris copied to clipboard

Error: release name: invalid release name

Open jkroepke opened this issue 2 years ago • 4 comments

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

jkroepke avatar Jul 13 '22 09:07 jkroepke

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 

jkroepke avatar Jul 13 '22 09:07 jkroepke

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

rbren avatar Jul 25 '22 15:07 rbren

Maybe should we allow to pass this as a flag? Like namespace?

tomislater avatar Jul 28 '22 12:07 tomislater

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

tomislater avatar Jul 28 '22 12:07 tomislater

This seems to have been fixed in the latest versions of Polaris, as we are using the --generate-name flag now.

sudermanjr avatar May 16 '23 22:05 sudermanjr