helm3-charts icon indicating copy to clipboard operation
helm3-charts copied to clipboard

nexus-iq: Helm Chart errors with lint issues

Open nichelia opened this issue 2 years ago • 3 comments

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)

nichelia avatar May 23 '22 11:05 nichelia

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?

jflinchbaugh avatar May 24 '22 15:05 jflinchbaugh

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 avatar May 30 '22 18:05 nichelia

Platform used, Docker image of Linux distribution Debian.

nichelia avatar May 30 '22 18:05 nichelia