-
Notifications
You must be signed in to change notification settings - Fork 32
CLOUDP-322487 - Change webhook's CR and CRB resource names to include operator name and namespace #393
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
Merged
Merged
CLOUDP-322487 - Change webhook's CR and CRB resource names to include operator name and namespace #393
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
be2afb0
add unit test
nammn dcc2ec2
add unit test
nammn c51782a
add unit test
nammn b13fdd0
add explicit cr and crb
nammn d7ec9ba
Merge branch 'master' into webhook-clusterrole
nammn 26431a5
add explicit cr and crb
nammn 033d782
Merge branch 'webhook-clusterrole' of github.com:mongodb/mongodb-kube…
nammn 6a322f3
remove comment
nammn 75cdd52
add changelog
nammn 96c2679
Update changelog/20250902_fix_helm_chart_webhook_per_namespace.md
nammn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: helm chart - webhook per namespace | ||
| kind: fix | ||
| date: 2025-09-02 | ||
| --- | ||
|
|
||
| * Changed webhook ClusterRole and ClusterRoleBinding default names to include the namespace. This ensures that multiple operator installations in different namespaces don't conflict with each other. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| suite: test webhook consistent clusterrole and binding | ||
| templates: | ||
| - operator-roles-webhook.yaml | ||
| tests: | ||
| - it: should have consistent ClusterRole and ClusterRoleBinding names | ||
| set: | ||
| operator.webhook.registerConfiguration: true | ||
| operator.webhook.installClusterRole: true | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 2 | ||
| - isKind: | ||
| of: ClusterRole | ||
| documentIndex: 0 | ||
| - isKind: | ||
| of: ClusterRoleBinding | ||
| documentIndex: 1 | ||
| - equal: | ||
| path: metadata.name | ||
| value: mongodb-kubernetes-operator-NAMESPACE-webhook-cr | ||
| documentIndex: 0 | ||
| - equal: | ||
| path: metadata.name | ||
| value: mongodb-kubernetes-operator-NAMESPACE-webhook-crb | ||
| documentIndex: 1 | ||
| - equal: | ||
| path: roleRef.name | ||
| value: mongodb-kubernetes-operator-NAMESPACE-webhook-cr | ||
| documentIndex: 1 | ||
|
|
||
| # Test that different installations get unique names (prevents conflicts) | ||
| - it: should create unique names per installation | ||
| set: | ||
| operator.name: my-operator | ||
| operator.namespace: custom-ns | ||
| operator.webhook.registerConfiguration: true | ||
| operator.webhook.installClusterRole: true | ||
| release: | ||
| namespace: custom-ns | ||
| asserts: | ||
| - equal: | ||
| path: metadata.name | ||
| value: my-operator-custom-ns-webhook-cr | ||
| documentIndex: 0 | ||
| - equal: | ||
| path: metadata.name | ||
| value: my-operator-custom-ns-webhook-crb | ||
| documentIndex: 1 | ||
| - equal: | ||
| path: roleRef.name | ||
| value: my-operator-custom-ns-webhook-cr | ||
| documentIndex: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
i've changed both names, because one was dynamic and one not - causing upgrade problems. Now both are just a new set of names.