You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened?
We found it impossible to remove the additional labels by unsetting the key-value pairs under the field spec.additionalServiceConfig.seedService.additionalLabels. We first added a label labelKey: labelValue under the additionalLabels field, and cass-operator correctly adds the label to the seed service. However, later we wanted to remove the labelKey: labelValue label from the seed service by deleting it from the CR. However, by doing so, cass-operator does not remove the additionalLabel from the seed service.
Did you expect to see something different?
We expected that the CR represents the desired state of the application, based on the declarative model of Kubernetes. So we expected that when remove the label from the spec.additionalServiceConfig.seedService.additionalLabels field, cass-operator would automatically remove this label from the seed service.
How to reproduce it (as minimally and precisely as possible):
Deploy cass-operator and the server-storage storage class
Deploy a basic CassandraDB using the example CR: kubectl apply -f example.yaml
Anything else we need to know?:
The root cause is inside the https://github.com/k8ssandra/cass-operator/blob/973cea89cad9d407fcac0f2ed388e98fdae3bc2a/pkg/reconciliation/reconcile_services.go#L103 where the labels in the desired service are merged into the existing service label map. The comment states that the reason of the merge is because cass-operator does not want to mess up the labels that are added by other sources.
A possible fix is to keep track of the labels that are added by the user using the spec.additionalServiceConfig.seedService.additionalLabels field, so that when users delete some labels from the field, cass-operator can delete these from the service.
The text was updated successfully, but these errors were encountered:
tylergu
changed the title
Unable to remove the additional labels on the seed service through CR
[cass-operator] Unable to remove the additional labels on the seed service through CR
May 8, 2022
What happened?
We found it impossible to remove the additional labels by unsetting the key-value pairs under the field
spec.additionalServiceConfig.seedService.additionalLabels
. We first added a labellabelKey: labelValue
under theadditionalLabels
field, and cass-operator correctly adds the label to the seed service. However, later we wanted to remove thelabelKey: labelValue
label from the seed service by deleting it from the CR. However, by doing so, cass-operator does not remove the additionalLabel from the seed service.Did you expect to see something different?
We expected that the CR represents the desired state of the application, based on the declarative model of Kubernetes. So we expected that when remove the label from the
spec.additionalServiceConfig.seedService.additionalLabels
field, cass-operator would automatically remove this label from the seed service.How to reproduce it (as minimally and precisely as possible):
Deploy cass-operator and the
server-storage
storage classDeploy a basic CassandraDB using the example CR:
kubectl apply -f example.yaml
example.yaml
Add additional labels to seed service by applying the cr1.yaml
cr1.yaml
Observe that the seed service now has the additional label
labelKey: labelValue
Delete the additionalLabels by applying the example CR again
Observe that the seed service still has the label
labelKey: labelValue
Environment
Cass Operator version:
docker.io/k8ssandra/cass-operator:v1.10.3
Kubernetes version information:
Kubernetes cluster kind:
Anything else we need to know?:
The root cause is inside the https://github.com/k8ssandra/cass-operator/blob/973cea89cad9d407fcac0f2ed388e98fdae3bc2a/pkg/reconciliation/reconcile_services.go#L103 where the labels in the desired service are merged into the existing service label map. The comment states that the reason of the merge is because cass-operator does not want to mess up the labels that are added by other sources.
A possible fix is to keep track of the labels that are added by the user using the
spec.additionalServiceConfig.seedService.additionalLabels
field, so that when users delete some labels from the field, cass-operator can delete these from the service.The text was updated successfully, but these errors were encountered: