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

Prevent CRTBs from being created with mismatching Namespace and ClusterName #294

Merged
merged 5 commits into from
Sep 15, 2023

Conversation

JonCrowther
Copy link
Contributor

Issue: rancher/rancher#42754

Problem

Users can create CRTBs that have different namespaces and ClusterNames. That causes their deletion to fail when the cluster is deleted. It also doesn't appear in the UI as intended.

Solution

  • Added a check on CREATE to ensure that the namespace and custerName are the same. Deny the request if they are mismatched
  • Added the same check on UPDATE, but just provide a warning to the user and allow it.

I also fixed the wording of one of the error messages to be more clear.

CheckList

  • Test
  • Docs

@JonCrowther JonCrowther self-assigned this Sep 15, 2023
cmurphy
cmurphy previously approved these changes Sep 15, 2023
MbolotSuse
MbolotSuse previously approved these changes Sep 15, 2023
Copy link
Contributor

@MbolotSuse MbolotSuse left a comment

Choose a reason for hiding this comment

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

Please squash your commits when merging, but outside of that LGTM.

maxsokolovsky
maxsokolovsky previously approved these changes Sep 15, 2023
@JonCrowther JonCrowther merged commit 731edba into rancher:release/v0.4 Sep 15, 2023
@JonCrowther JonCrowther deleted the fix-crtb-bugs branch September 15, 2023 19:48
rohitsakala pushed a commit to rohitsakala/webhook that referenced this pull request Nov 1, 2023
…erName (rancher#294)

* Fix 42754

* Update create error message to have consistent wording

* Update CRTB docs

* Address comments

* Update integration test
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.

4 participants