Charts: [stable/jenkins] helm template - error calling semverCompare: Invalid Semantic Version

Created on 4 Nov 2019  路  6Comments  路  Source: helm/charts

Describe the bug
when running the below commands we see the following errors: error calling semverCompare: Invalid Semantic Version

Error: render error in "jenkins/templates/jenkins-master-deployment.yaml": template: jenkins/templates/jenkins-master-deployment.yaml:42:28: executing "jenkins/templates/jenkins-master-deployment.yaml" at <include (print $.Template.BasePath "/config.yaml") .>: error calling include: template: jenkins/templates/config.yaml:139:7: executing "jenkins/templates/config.yaml" at <semverCompare ">=1.20.2" (include "jenkins.kubernetes-version" .)>: error calling semverCompare: Invalid Semantic Version

these are the lines which are causing the error:

## local file path: out/jenkins/templates/config.yaml

{{- if semverCompare ">=1.20.2" (include "jenkins.kubernetes-version" . ) }}
          <directConnection>false</directConnection>
{{- end }}

if i comment them out it works without errors.

Version of Helm and Kubernetes:

$ helm version
Client: &version.Version{SemVer:"v2.15.2", GitCommit:"8dce272473e5f2a7bf58ce79bb5c3691db54c96b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.15.2", GitCommit:"8dce272473e5f2a7bf58ce79bb5c3691db54c96b", GitTreeState:"clean"}

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T16:54:35Z", GoVersion:"go1.12.7", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:07:57Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}

Which chart:
stable/jenkins

How to reproduce it (as minimally and precisely as possible):

$ helm fetch stable/jenkins --untar --untardir=./out
$ helm template ./out/jenkins --values utils/infrastructure-cluster/helm/jenkins-values.yaml >> out.yaml
Error: render error in "jenkins/templates/jenkins-master-deployment.yaml": template: jenkins/templates/jenkins-master-deployment.yaml:42:28: executing "jenkins/templates/jenkins-master-deployment.yaml" at <include (print $.Template.BasePath "/config.yaml") .>: error calling include: template: jenkins/templates/config.yaml:139:7: executing "jenkins/templates/config.yaml" at <semverCompare ">=1.20.2" (include "jenkins.kubernetes-version" .)>: error calling semverCompare: Invalid Semantic Version

anyone?

All 6 comments

Looks like this commit introduced the regression. ~It's preventing me from enabling JCasC. I'll post a minimal reproducible example later.~ My specific issue was unrelated

cc @bergemalm - have a look.

@HerrmannHinz Maybe you're using latest as version for the kubernetes plugin?
Anyway, they decided to set the new direct connection setting for the kubernetes plugin to false instead of true by default so I made a new pr removing what was added to fix that issue here:
https://github.com/helm/charts/pull/18490

Still waiting for response on that one.

@bergemalm this is my values file:

master:
  image: "jenkins/jenkins"
  tag: "2.202-alpine"
  imagePullPolicy: "IfNotPresent"
  component: "jenkins"
  useSecurity: false
  resources:
    requests:
      cpu: "1000m"
      memory: "4Gi"
    limits:
      cpu: "1000m"
      memory: "4Gi"
  initContainerEnv:
    - name: JENKINS_INCREMENTALS_REPO_MIRROR
      value: https://repo.jenkins-ci.org/incrementals
  containerEnv:
    - name: JENKINS_SLAVE_AGENT_PORT
      value: "50000"
    - name: JENKINS_INCREMENTALS_REPO_MIRROR
      value: https://repo.jenkins-ci.org/incrementals
    # - name: CASC_JENKINS_CONFIG
    #   value: /var/jenkins_casc/casc_configs
  # set timezone and stuff / change default Content Security Policy
  javaOpts: >
    -Dorg.apache.commons.jelly.tags.fmt.timeZone=Europe/Berlin
    -Duser.timezone=Europe/Berlin
    -Dhudson.slaves.ChannelPinger.pingIntervalSeconds=60
    -Dhudson.model.DirectoryBrowserSupport.CSP=""

# Set min/max heap here if needed with:
# JavaOpts: "-Xms512m -Xmx512m"
# Optionally configure a JMX port
# requires additional JavaOpts, ie
# JavaOpts: >
#   -Dcom.sun.management.jmxremote.port=4000
#   -Dcom.sun.management.jmxremote.authenticsate=false
#   -Dcom.sun.management.jmxremote.ssl=false
# JMXPort: 4000
# List of plugins to be install during Jenkins master start
  installPlugins:
      - git:3.12.1
      - slack:2.34
      - configuration-as-code:1.32

  servicePort: 8080
  serviceType: ClusterIP
  serviceAnnotations: {}
  containerPort: 8080
  slaveListenerPort: 50000

  ingress:
    hostName: jenkins.infrastructure.caas.xxxx.xxxxx.io
    enabled: true
    annotations:
      zalando.org/aws-load-balancer-scheme: internal


persistence:
  enabled: false
  ## A manually managed Persistent Volume and Claim
  ## Requires Persistence.Enabled: true
  ## If defined, PVC must be created manually before volume will be bound
  existingClaim: jenkins-non-prod

  ## mount in the casc yaml from a configmap
  # volumes:
  # - name: casc-config
  #   configMap:
  #     name: jenkins-casc-config
  # mounts:
  # - name: casc-config
  #   mountPath: /var/jenkins_casc/casc_configs
  #   readOnly: true

no kubernetes plugin at all. oO
the idea was to install all other necessary plugins via JCasc.

i'll keep an eye on your PR. thanks for the heads up.

https://github.com/helm/charts/pull/18490 has been merged. Should solve this issue.
@HerrmannHinz

@bergemalm works now - thanks!

Was this page helpful?
0 / 5 - 0 ratings