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

fix: webhook: Don't check common template namespace #747

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

akrejcir
Copy link
Collaborator

@akrejcir akrejcir commented Dec 4, 2023

What this PR does / why we need it:
The namespace of common templates is not checked in webhook.

Even if the webhook passes, user can still remove the namespace later.

Fixes: #746
Fixes: https://issues.redhat.com/browse/CNV-35920

Release note:

Validation webhook does not check if namespace for templates exists.

Extracted common functionality from ValidateCreate and ValidateUpdate
functions.

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
The namespace of common templates is not checked in webhook.

Even if the webhook passes, user can still remove the namespace later.

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Dec 4, 2023
Copy link

sonarqubecloud bot commented Dec 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@akrejcir
Copy link
Collaborator Author

akrejcir commented Dec 4, 2023

/cc @0xFelix

@kubevirt-bot kubevirt-bot requested a review from 0xFelix December 4, 2023 16:28
Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0xFelix

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 Dec 5, 2023
@akrejcir
Copy link
Collaborator Author

akrejcir commented Dec 5, 2023

/cc @ksimon1

@kubevirt-bot kubevirt-bot requested a review from ksimon1 December 5, 2023 13:10
@ksimon1
Copy link
Member

ksimon1 commented Dec 6, 2023

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2023
@kubevirt-bot kubevirt-bot merged commit 5428531 into kubevirt:main Dec 6, 2023
5 checks passed
@akrejcir akrejcir deleted the webhook-templates-namespace branch December 6, 2023 14:19
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 Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code duplication in ssp_webhook.go
4 participants