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

nexus-iq: Helm Chart errors with lint issues #201

Open
nichelia opened this issue May 23, 2022 · 3 comments
Open

nexus-iq: Helm Chart errors with lint issues #201

nichelia opened this issue May 23, 2022 · 3 comments

Comments

@nichelia
Copy link

The current version of nexus-iq Helm Chart (version: 137.0.0, appVersion: 1.137.0) fails with the following Helm error:

[ERROR] templates/: parse error at (nexus-iq-server/templates/_helpers.tpl:70): unclosed action
Error: 1 chart(s) linted, 1 chart(s) failed

How to replicate

  • Clone current repo with main repo
  • Go to nexus-iq/helm3-charts/charts
  • Run helm lint nexus-iq/ --strict

Issue

The below helper function is causing the Helm Chart to complain on template compilation.
If the new lines are removed, Helm lint is satisfied.

{{/*
Create the value for internal host system value from the image repository value.
*/}}
{{- define "iqserver.internalHostSystem" -}}
  {{- $systems := dict
        "sonatype/nexus-iq-server" "Helm+Docker"
        "registry.connect.redhat.com/sonatype/nexus-iq-server" "Helm+RedHat"
  -}}
  {{- .Values.image.repository
      | default ""
      | get $systems
      | default "Helm+Other"
    -}}
{{- end -}}

Versions

Helm Version: version.BuildInfo{Version:"v3.5.2", GitCommit:"167aac70832d3a384f65f9745335e9fb40169dc2", GitTreeState:"dirty", GoVersion:"go1.15.7"}

(also tried with latest released version of Helm 3)

@jflinchbaugh
Copy link
Contributor

Hmm. I'm having trouble reproducing that error with Helm 3.9.0 on MacOS.

$ helm version
version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.18.2"}
$ helm lint nexus-iq/ --strict
==> Linting nexus-iq/

1 chart(s) linted, 0 chart(s) failed

I can ask around for other attempts at a reproduction. What platform are you using when linting? Can you be more specific about which whitespaces you'd eliminate?

@nichelia
Copy link
Author

Hi @jflinchbaugh, thank you for checking.

I have changed the mentioned function to the below:

{{/*
Create the value for internal host system value from the image repository value.
*/}}
{{- define "iqserver.internalHostSystem" -}}
  {{- $systems := dict "sonatype/nexus-iq-server" "Helm+Docker" "registry.connect.redhat.com/sonatype/nexus-iq-server" "Helm+RedHat" -}}
  {{- .Values.image.repository | default "" | get $systems | default "Helm+Other" -}}
{{- end -}}

@nichelia
Copy link
Author

Platform used, Docker image of Linux distribution Debian.

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

No branches or pull requests

2 participants