-
Notifications
You must be signed in to change notification settings - Fork 100
SREP-2356 bug fix : Adding service account to fix the issue #467
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
Open
ratnam915
wants to merge
5
commits into
openshift:master
Choose a base branch
from
ratnam915:feature/SREP-2356
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
810e520
Fixing the bug by adding service account
ratnam915 5363252
Adding MOU to the list of exclusions
ratnam915 f2c7a60
Minor changes, rebulit syncset
ratnam915 b267837
Fixing test cases
ratnam915 2d91c23
Making changes as per review
ratnam915 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ import ( | |
|
|
||
| const ( | ||
| WebhookName string = "network-operator-validation" | ||
| docString string = `Managed OpenShift customers may not modify critical fields in the network.operator CRD (such as spec.migration.networkType) because it can disrupt Cluster Network Operator operations and CNI migrations. Only backplane-cluster-admin and SRE service accounts are allowed to modify these critical fields. Regular cluster-admin users (system:admin) are explicitly blocked.` | ||
| docString string = `Managed OpenShift customers may not modify critical fields in the network.operator CRD (such as spec.migration.networkType) because it can disrupt Cluster Network Operator operations and CNI migrations. Only backplane-cluster-admin, SRE service accounts, and the Cluster Network Operator (CNO) service account are allowed to modify these critical fields. Regular cluster-admin users (system:admin) are explicitly blocked.` | ||
| ) | ||
|
|
||
| var ( | ||
|
|
@@ -43,9 +43,11 @@ var ( | |
| "backplane-cluster-admin", | ||
| } | ||
|
|
||
| // Groups allowed to modify critical migration fields | ||
| // Groups allowed to modify critical migration fields (SRE and the Cluster Network Operator) | ||
| sreAdminGroups = []string{ | ||
| "system:serviceaccounts:openshift-backplane-srep", | ||
| // CNO runs in openshift-network-operator and must be able to patch network.operator for CNI migration | ||
| "system:serviceaccounts:openshift-network-operator", | ||
|
||
| } | ||
| ) | ||
|
|
||
|
|
@@ -284,10 +286,10 @@ func (w *NetworkOperatorWebhook) SyncSetLabelSelector() metav1.LabelSelector { | |
| return utils.DefaultLabelSelector() | ||
| } | ||
|
|
||
| func (w *NetworkOperatorWebhook) ClassicEnabled() bool { return false } | ||
| func (w *NetworkOperatorWebhook) ClassicEnabled() bool { return true } | ||
|
|
||
| // HypershiftEnabled will return boolean value for hypershift enabled configurations | ||
| func (w *NetworkOperatorWebhook) HypershiftEnabled() bool { return false } | ||
| func (w *NetworkOperatorWebhook) HypershiftEnabled() bool { return true } | ||
|
|
||
| // NewWebhook creates a new webhook | ||
| func NewWebhook() *NetworkOperatorWebhook { | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.