replicatedhq / helm-charts

Apache License 2.0
4 stars 6 forks source link

livenessProbe type `exec` renders incorrectly #121

Closed adamancini closed 1 year ago

adamancini commented 1 year ago

with values.yaml

apps:
  app1:
    containers:
      base:
        image:
          repository: hello-world
          tag: '1'
        livenessProbe:
          exec:
            command:
              - /bin/sh
              - -c
              - pidof node

renders

          livenessProbe:
            exec:
              command:
              - /bin/sh
              - -c
              - pidof node
            failureThreshold: 5
            httpGet:
              path: /healthz
              port: http
            initialDelaySeconds: 0
            periodSeconds: 10
            successThreshold: 1
            terminationGracePeriodSeconds: 30
            timeoutSeconds: 5

the additional httpGet: stanza causes the manifest to fail validation

diamonwiggins commented 1 year ago

From first glance it looks like the issue is - https://github.com/replicatedhq/helm-charts/blob/main/charts/replicated-library/templates/lib/_container.tpl#L69.

Looks like the value of $containerValues.livenessProbe is being appended to $.Values.defaults.probes.livenessProbe each time it iterates through the list of the containers expanding the configuration of the probes leading to multiple handlers.