helm-images icon indicating copy to clipboard operation
helm-images copied to clipboard

Handle images in HelmChartConfig

Open Leobaillard opened this issue 11 months ago • 2 comments

For my use case, I have a HelmChartConfig template that edits the default configuration for the Traefik instance in my clusters. It seems that helm-images is not able to get the images inside of that object type.

Here is an example:

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    deployment:
      kind: DaemonSet
      additionalContainers:
        - name: nxlog
          image: {{ tpl .Values.log.images.nxlog . | replace "//" "/" }}
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          env:
            - name: "PUID"
              value: "65532"
            - name: "GUID"
              value: "65532"
          volumeMounts:
            - name: fifo-logs
              mountPath: /logs
            - name: traefik-nxlog-config
              mountPath: /etc/nxlog/nxlog.conf
              subPath: nxlog.conf

In this case, the images in the valuesContent are not handled. Could this be added?

Thanks!

Leobaillard avatar Feb 29 '24 11:02 Leobaillard

@Leobaillard , at the moment the plugin doesn't support HelmChartConfig. Once I'm back, I'll check the feasibility of this and add support for the same.

nikhilsbhat avatar Mar 04 '24 15:03 nikhilsbhat

A temporary workaround is to extract the valuesContent and pass them to helm, e.g.

override="$(mktemp)"
yq '.spec.ValuesContent' path/to/HelmChartConfig.yaml >"$override"
helm images get traefik path/to/traefik/chart -f "$override"

thejan2009 avatar Mar 10 '24 07:03 thejan2009