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

[release-v0.18] fix: Remove namespaceSelector from webhook definition #979

Merged

Conversation

akrejcir
Copy link
Collaborator

@akrejcir akrejcir commented May 2, 2024

This is a backport of: #879

What this PR does / why we need it:
The ValidatingWebhookConfiguration created by OLM can have namespaceSelector field set. We don't want it, because the webhook checks that there is only one SSP resource in the cluster.

Which issue(s) this PR fixes:
Jira: https://issues.redhat.com/browse/CNV-36636

Release note:

None

The ValidatingWebhookConfiguration created by OLM can have
namespaceSelector field set. We don't want that, because
the webhook checks that there is only one SSP resource
in the cluster.

This commit adds a controller that watches
ValidatingWebhookConfigurations and removes the namespaceSelector,
if the object has a specific label.

Cherry-pick fron: 948eeaa

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels May 2, 2024
Some changes were needed from the PR in main branch.
- "slices" package is not yet in go 1.19
- The "TypeMeta" needs to be defined in objects used in unit tests.
- Do not use "k8s.io/utils/ptr" package.

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
@akrejcir akrejcir force-pushed the webhook-namespace-selector-0.18 branch from eb15581 to 52995a8 Compare May 2, 2024 12:37
Copy link

sonarcloud bot commented May 2, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots
C Security Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@akrejcir
Copy link
Collaborator Author

akrejcir commented May 3, 2024

Waiting for QE to confirm that we want this.

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 3, 2024
@akrejcir
Copy link
Collaborator Author

akrejcir commented May 9, 2024

QE wants this backport.

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 9, 2024
@akrejcir
Copy link
Collaborator Author

akrejcir commented May 9, 2024

/cc @ksimon1 @0xFelix @jcanocan

@kubevirt-bot kubevirt-bot requested a review from jcanocan May 9, 2024 11:26
@jcanocan
Copy link
Contributor

jcanocan commented May 9, 2024

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 9, 2024
@lyarwood
Copy link
Member

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lyarwood

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 15, 2024
@kubevirt-bot kubevirt-bot merged commit d613183 into kubevirt:release-v0.18 May 15, 2024
11 checks passed
@akrejcir akrejcir deleted the webhook-namespace-selector-0.18 branch May 15, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants