Skip to content

Helm: CephConnection template requires crushLocationLabels be set #382

@sshambar

Description

@sshambar

Describe the bug

readAffinity is an optional key in the ceph-csi config.json and in the CephConnection.spec object, but the helm chart requires .Values.cephConnections.crushLocationLabels have a non-empty list.

Environment details

  • Image/version of ceph-csi-operator : 0.4.1
  • Image/version of Ceph-CSI driver : v3.15.0
  • Kubernetes cluster version : v1.33.5
  • Ceph cluster version : 19.2.3

Steps to reproduce

Install the helm ceph-csi-drivers chart without defining a value for .Values.cephConnections.crushLocationLabels

Actual results

Error: UPGRADE FAILED: cannot patch "ceph-cluster" with kind CephConnection: CephConnection.csi.ceph.io "ceph-cluster" is invalid: spec.readAffinity.crushLocationLabels: Required value

Expected behavior

Chart installed

Additional context

If .Values.cephConnections.crushLocationLabels is empty, the cephConnection.yaml template defines an empty object CephConnection.spec.readAffinity, but the CRD requires that if readAffinity is defined that readAffinity.crushLocationLabels have at least 1 item and generates an error.

If the template was updated with:

  {{- if not (empty $cephConnection.crushLocationLabels) }}
  readAffinity:
    crushLocationLabels:
    {{- range $cephConnection.crushLocationLabels }}
    - {{ . }}
    {{- end }}
  {{- end }}

the template would produce the correct object when .Values.cephConnections.crushLocationLabels has no value.

NOTE: the chart's values.yaml defines crushLocationLabels: {} -- but since the value is a list, it should define crushLocationLabels: []

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions