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?
I was migrating an existing cluster to the cass-operator and it had a Cluster name of Test Cluster. This caused cass-operator to try to label some resources with incorrect labels:
Warning ReconcileFailed 72s (x8 over 83s) cass-operator Service "testcluster-seed-service" is invalid: [metadata.labels: Invalid value: "cassandra-Test Cluster": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), metadata.labels: Invalid value: "Test Cluster": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), spec.selector: Invalid value: "Test Cluster": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')]
We validate clusterName in multiple places and strip incorrect characters. We should be doing the same in these labels also (and ensure that the queries still work).
Did you expect to see something different?
How to reproduce it (as minimally and precisely as possible):
Create CassDc with Cluster: Test Cluster.
Environment
Cass Operator version:
Insert image tag or Git SHA here
* Kubernetes version information:
kubectl version
* Kubernetes cluster kind:
insert how you created your cluster: kops, bootkube, etc.
Manifests:
insert manifests relevant to the issue
Cass Operator Logs:
insert Cass Operator logs relevant to the issue here
Anything else we need to know?:
┆Issue is synchronized with this Jira Task by Unito
┆friendlyId: K8SSAND-1523
┆priority: Medium
The text was updated successfully, but these errors were encountered:
A good way would be to use the given regexp (regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')) and just take the input from Cluster field and remove all chars that do not conform to this regexp.
That way all existing clusters would be unimpacted.
What happened?
I was migrating an existing cluster to the cass-operator and it had a Cluster name of
Test Cluster
. This caused cass-operator to try to label some resources with incorrect labels:We validate clusterName in multiple places and strip incorrect characters. We should be doing the same in these labels also (and ensure that the queries still work).
Did you expect to see something different?
How to reproduce it (as minimally and precisely as possible):
Create CassDc with
Cluster: Test Cluster
.Environment
Cass Operator version:
* Kubernetes version information:Insert image tag or Git SHA here
* Kubernetes cluster kind:kubectl version
Anything else we need to know?:
┆Issue is synchronized with this Jira Task by Unito
┆friendlyId: K8SSAND-1523
┆priority: Medium
The text was updated successfully, but these errors were encountered: