k8ssandra/cass-operator

Fix sanitization of the datacenter label

Closed this issue · 0 comments

When creating a DC with case-sensitive CQL name overrides:

apiVersion: cassandra.datastax.com/v1beta1
kind: CassandraDatacenter
metadata:
  namespace: test
  name: k8s-dc1
spec:
  clusterName: Cql_Cluster
  datacenterName: Cql_DataCenter1
  racks:
    - name: Cql_Rack1
  serverType: cassandra
  serverVersion: 4.1.0
  size: 1
  storageConfig:
    cassandraDataVolumeClaimSpec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 100Mi
      storageClassName: standard

The following labels are applied to the Cassandra pods:

cassandra.datastax.com/cluster=Cql_Cluster
cassandra.datastax.com/datacenter=cql-datacenter1
cassandra.datastax.com/rack=Cql_Rack1

The datacenter label is inconsistent: it should be sanitized with CleanLabelValue instead of CleanupForKubernetes.