-
Notifications
You must be signed in to change notification settings - Fork 327
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
Apply constraints for immutable fields only to CREATE operations #346
Comments
Hi @ordovicia - Thanks for opening an issue! Rather than limiting |
Thank you for your swift comment! |
Related issue (which reaches no conclusions): |
This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
I created PR #348 that would fix this issue. |
Sorry for the delay in reviewing. @apeabody does the PR LGTY? |
It would also be good to have a general solution to the "need to remove a finalizer" problem (IMO not a pre-requisite for this PR). |
Thanks @maxsmythe! The basics look good, I just had a question on the inclusion of "PATCH", and we should probably include template level test coverage of the new behavior. #348 (review) |
This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
#348 will fix this issue. |
Problem
Constraint templates for immutable fields (e.g.
K8sPSPHostFilesystem
validates pods' volumes) are enforced forUPDATE
operations when the Gatekeeper's validating admission webhook is configured to be applied toUPDATE
operation.This can cause the following situation:
K8sPSPHostFilesystem
constraint withallowedHostPaths: [{ pathPrefix: "/app" }]
is on a cluster/app
host path volume/app
path prefix fromallowedHostPaths
of theK8sPSPHostFilesystem
constraint/app
host path volume and it now voilates theK8sPSPHostFilesystem
constraint/app
host path volume also cannot be removed from the pod, because pods' volume config is immutable.Possible solution 1
Configuring the Gatekeeper's validating webhook to be applied only to
CREATE
operation.This solution cannot be adopted if a cluster has constrains for mutable fields (e.g.
K8sRequiredLabels
).Possible soultion 2
Modifying constraints templates for immutable fields to be applied only to
CREATE
operation.This solution can be implemented by adding a
input.review.operation
condition to constraint definitions written in Rego.What do you think?
The text was updated successfully, but these errors were encountered: