bjw-s / helm-charts

A collection of Helm charts
https://bjw-s.github.io/helm-charts/
Apache License 2.0
535 stars 100 forks source link

Error since update to 2.0.1 #216

Closed zewelor closed 8 months ago

zewelor commented 8 months ago

Details

What steps did you take and what happened:

Changed app-template version from 2.0.0 to 2.0.1 ( 2.0.3 gives the same error )

What did you expect to happen:

Template rendered

Anything else you would like to add:

Im getting following error:

Error: template: vscode/charts/app-template/templates/common.yaml:14:3: executing "vscode/charts/app-template/templates/common.yaml" at <include "bjw-s.common.loader.generate" .>: error calling include: template: vscode/charts/app-template/charts/common/templates/loader/_generate.tpl:8:6: executing "bjw-s.common.loader.generate" at <include "bjw-s.common.render.controllers" .>: error calling include: template: vscode/charts/app-template/charts/common/templates/render/_controllers.tpl:25:12: executing "bjw-s.common.render.controllers" at <include "bjw-s.common.class.deployment" (dict "rootContext" $ "object" $deploymentObject)>: error calling include: template: vscode/charts/app-template/charts/common/templates/classes/_deployment.tpl:59:13: executing "bjw-s.common.class.deployment" at <include "bjw-s.common.lib.pod.spec" (dict "rootContext" $rootContext "controllerObject" $deploymentObject)>: error calling include: template: vscode/charts/app-template/charts/common/templates/lib/pod/_spec.tpl:61:12: executing "bjw-s.common.lib.pod.spec" at <include "bjw-s.common.lib.pod.field.containers" (dict "ctx" $ctx)>: error calling include: template: vscode/charts/app-template/charts/common/templates/lib/pod/fields/_containers.tpl:22:30: executing "bjw-s.common.lib.pod.field.containers" at <include "bjw-s.common.lib.container.spec" (dict "rootContext" $rootContext "controllerObject" $controllerObject "containerObject" $containerObject)>: error calling include: template: vscode/charts/app-template/charts/common/templates/lib/container/_spec.tpl:48:12: executing "bjw-s.common.lib.container.spec" at <include "bjw-s.common.lib.container.field.volumeMounts" (dict "ctx" $ctx)>: error calling include: template: vscode/charts/app-template/charts/common/templates/lib/container/fields/_volumeMounts.tpl:28:14: executing "bjw-s.common.lib.container.field.volumeMounts" at <eq (dig "statefulset" "volumeClaimTemplates" nil $controllerObject) nil>: error calling eq: uncomparable type []interface {}: []

Additional Information:

I'm using argocd and this is my values.yaml file, which works on 2.0.0:

app-template:
  # Common library: https://github.com/bjw-s/helm-charts/tree/main/charts/library/common
  # https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml
  # https://github.com/linuxserver/docker-code-server
  controllers:
    main:
      containers:
        main:
          image:
            repository: ghcr.io/linuxserver/code-server
            tag: 4.18.0
          env:
            TZ: "Europe/Warsaw"
            PUID: "1000"
            PGID: "1000"
            DOCKER_MODS: "linuxserver/mods:code-server-python3"

  service:
    main:
      ports:
        http:
          enabled: true
          port: 8443
          primary: true  # Assuming you want this to be the primary port based on your old values

  persistence:
    config:
      enabled: true
      type: persistentVolumeClaim
      size: 1Gi
      retain: true  # Assuming you do not want to retain the PVC upon `helm uninstall`
mkoval commented 8 months ago

I get the same error on 2.0.1 and 2.0.2 on the exact example from the docs.

bjw-s commented 8 months ago

Thank you for reporting the issue. I will investigate and try to see what's going on

zewelor commented 8 months ago

If it will help something. I've tested other deploy I've got, and it works with 2.0.3. I think difference is that it uses:

  persistence:
    config:
      enabled: true
      existingClaim: audiobookshelf-config

So maybe its in case that existingClaim for config is missing ?

binaryn3xus commented 8 months ago

I am also having this issue in v2.0.3 as well.

It works great in my FluxCD environment. However, trying to apply it manually for a project I have - that doesnt use gitops for my cluster - I get this error as well. Not sure if this information is helpful in troubleshooting but I thought I would share regardless.

bjw-s commented 8 months ago

Hmm... this is very strange. I just added the values from the OP to a values.yaml file and ran helm template -f values.yaml --debug and this works without any issue.

What Helm version are you using?

zewelor commented 8 months ago

I'm using:

version.BuildInfo{Version:"v3.10.1", GitCommit:"9f88ccb6aee40b9a0535fcc7efea6055e1ef72c9", GitTreeState:"clean", GoVersion:"go1.18.7"}
bjw-s commented 8 months ago

That looks to be the culprit. When I downgrade my Helm version to that, I see the same error. I will see if there is anything I can do about it.

bjw-s commented 8 months ago

I think I have found the problem and have implemented a fix in v2.1.0.

zewelor commented 8 months ago

Great news, thanks !

zewelor commented 8 months ago

Confirmed worked without problems, on problematic charts !