-
Notifications
You must be signed in to change notification settings - Fork 309
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
webhook: validate owned-by annotation on create, update, delete #5031
webhook: validate owned-by annotation on create, update, delete #5031
Conversation
This annotation is already validated on the PVC current object in the Delete handler, but to be more consistent, also check the new object in the Update and Create handlers. Signed-off-by: Connor Kuehl <connor.kuehl@suse.com>
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.
LGTM. Thank you.
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.
lgtm. thanks.
Wait a minute: For VM related PVCs, the In v1.2.1 and later,
|
Should we add another annotation like In Harvester, user may also use helm to deploy other charts (we know some customers are doing so), those related PVCs will have no such annotations. |
The webhook doesn't require that harvesterhci.io/owned-by is present, it only requires that if the annotation is there that it has the correct structure. It won't reject Rancher's PVCs. harvester/pkg/ref/annotation.go Line 197 in fe90d54
|
Got it, great, thanks. |
@Mergifyio backport v1.2 |
✅ Backports have been created
|
@Mergifyio backport v1.1 |
✅ Backports have been created
|
This annotation is already validated on the PVC current object in the Delete handler, but to be more consistent, also check the new object in the Update and Create handlers.