Skip to content
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

Restrict the mutating webhook to cass-operator managed pods #1173

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

adejanovski
Copy link
Contributor

What this PR does:
Our mutating webhook currently breaks kubernetes clusters as soon as the k8ssandra-operator pod gets unresponsive or deleted.
This is because the webhook will stay registered and is currently mutating ALL pods in the cluster.
Instead we need to restrict it to pods created by cass-operator as they're the only ones we need to act upon.
This PR modifies the objectSelector to target pods with the app.kubernetes.io/created-by: cass-operator label only.

Which issue(s) this PR fixes:
Fixes #1172

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f921858) 57.04% compared to head (376d443) 57.08%.
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1173      +/-   ##
==========================================
+ Coverage   57.04%   57.08%   +0.03%     
==========================================
  Files         101      101              
  Lines       10428    10428              
==========================================
+ Hits         5949     5953       +4     
+ Misses       3957     3956       -1     
+ Partials      522      519       -3     

see 4 files with indirect coverage changes

@adejanovski adejanovski marked this pull request as ready for review January 15, 2024 12:17
@adejanovski adejanovski requested a review from a team as a code owner January 15, 2024 12:17
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@burmanm burmanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks correct, I assume the MultiMedusaJob didn't fail because of this (as it shouldn't be dependant on this).

@adejanovski adejanovski merged commit 413f04f into main Jan 16, 2024
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The k8ssandra-operator mutating webhook should be restricted to cass-operator managed pods
2 participants