#7732·headlamp

charts: pvc: Only the last accessModes entry is applied

Author: CapThunder19Created Sep 21, 2026Updated Sep 21, 2026
Labelskind/bug

Describe the bug

In the Helm chart persistentVolumeClaim.accessModes is a list, but the template writes the accessModes: key inside the range loop:

yaml
{{- range .Values.persistentVolumeClaim.accessModes}}
accessModes:
  - {{ . }}
{{- end}}

so with two or more modes the rendered manifest has duplicate accessModes keys. Helm and kubectl parse that non-strictly, so only the last entry survives and the PVC is created with the wrong access modes nothing warns about it helm lint passes

Expected: all configured access modes end up on the PVC

Related: with the default accessModes: [] and enabled: true, no accessModes key is rendered at all and the API server rejects the PVC (spec.accessModes: Required value) size has a required guard, accessModes doesn't

To Reproduce

  1. Save this as values.yaml:
    yaml
    persistentVolumeClaim:
      enabled: true
      size: 10Gi
      accessModes: [ReadWriteOnce, ReadOnlyMany]
  2. Run helm template hl charts/headlamp -f values.yaml --show-only templates/pvc.yaml
  3. Output has accessModes: twice:
    yaml
    spec:
      accessModes:
        - ReadWriteOnce
      accessModes:
        - ReadOnlyMany
  4. Pipe the output through kubectl create --dry-run=client -o yaml -f - only ReadOnlyMany remains

Environment

  • Installation type: Helm
  • Headlamp Version: chart 0.45.0 (current main, charts/headlamp/templates/pvc.yaml)
  • Other: Helm v3.19.0

Are you able to fix this issue?

Yes I will propose a PR

Additional Context

Not a regression the block has been like this since PVC support was added to the chart. Previous fixes touched storageClassName (#2579) and size (#2706) in the same template but not accessModes

Source: kubernetes-sigs/headlamp