-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix name override issues #1246
Fix name override issues #1246
Conversation
- reject cluster creation if a DC has an invalid name - always use sanitized DC name override when naming secondary resources - use cluster name override for metrics agent configMap Fixes k8ssandra#1138 Fixes k8ssandra#1141
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1246 +/- ##
==========================================
- Coverage 57.45% 57.43% -0.02%
==========================================
Files 103 103
Lines 10794 10801 +7
==========================================
+ Hits 6202 6204 +2
- Misses 4057 4060 +3
- Partials 535 537 +2
|
I don't think the CI issue is related. I didn't touch anything related to backup/restore, and it's also timing out on main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@olim7t Need to add a Changelog entry too I guess |
Quality Gate failedFailed conditions |
What this PR does:
1) Handle the case where a DC's
metadata.name
cannot be used directly as a Kubernetes resource name:I changed the validation webhook to reject this. I think this is the best solution because we already provide the
datacenterName
override for cases where the CQL name couldn't be used here. We could sanitizemetadata.name
when it's not valid, but that would bring even more confusion IMO.2) Fix the naming of some secondary resources (ConfigMaps, etc.) that were incorrectly using the unsanitized override. For example, given:
The operator would generate resource names such as
...-Data_Center_1-metrics-agent-config
which is obviously wrong. I've changed those to sanitize the override:...-data-center-1-metrics-agent-config
.On a related note, I also fixed the metrics agent configMap, which was using the wrong cluster name.
Which issue(s) this PR fixes:
Fixes #1141
Fixes #1138
Checklist