MaikuMori / helm-charts

Maiku's Helm charts
https://artifacthub.io/packages/search?user=MaikuMori&sort=relevance
MIT License
18 stars 11 forks source link

Gotenberg: Helm installation fails because of incorrect access in with block #39

Closed SimonWoidig closed 2 months ago

SimonWoidig commented 2 months ago

Version 1.5.0 of the Gotenberg chart fails installation. I am using the chart as a dependency of my chart. The installation fails with:

Error: template: myproject/charts/gotenberg/templates/deployment.yaml:246:22: executing "myproject/charts/gotenberg/templates/deployment.yaml" at <.Values.api.tlsSecretName>: can't evaluate field Values in type []interface {}

The problem is here: https://github.com/MaikuMori/helm-charts/blob/28542217fc1e3a791114a957454b71c903cc9353/charts/gotenberg/templates/deployment.yaml#L243-L251

As you can se, there is a with block using .Values.volumes. In the volumes, you are trying to access .Values.api.tlsSecretName, which fails. It should rather be $.Values.api.tlsSecretName to reference the global scope instead of the .Values.volumes.XYZ scope.

If it helps anything, here are my values:

gotenberg:
  replicaCount: 1
  image:
    repository: gotenberg/gotenberg
    tag: ""
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  podAnnotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "3000"
    prometheus.io/path: "/prometheus/metrics"
  podSecurityContext:
    fsGroup: 1001
  securityContext:
    privileged: false
    runAsNonRoot: true
    runAsUser: 1001
    runAsGroup: 1001
    allowPrivilegeEscalation: false
    readOnlyRootFilesystem: true
  volumes:
    - name: tmp
      emptyDir: {}
    - name: gotenberg-home
      emptyDir: {}
  volumeMounts:
    - name: tmp
      mountPath: /tmp
    - name: gotenberg-home
      mountPath: /home/gotenberg
  service:
    type: ClusterIP
    port: 8080
  resources:
    limits:
      cpu: 2000m
      memory: 1024Mi
    requests:
      cpu: 100m
      memory: 128Mi
  ingress:
    enabled: false
  api:
    port: 3000
    timeout: "600s"
    disableHealthCheckLogging: true
  libreOffice:
    disableRoutes: true
    unoListenerRestartThreshold: "0"
  pdfEngines:
    disableRoutes: true
  webhook:
    disable: true
  logging:
    format: "json"
SimonWoidig commented 2 months ago

Forked, fixed and created a PR here - https://github.com/MaikuMori/helm-charts/pull/40.

Tried with minimal values and validated the fix.

volumes:
  - name: tmp
    emptyDir: {}