You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
We have the following constrainttemplate which works fine during create, update events. As soon as we keep the resource in the namespace and delete the whole namespace (like in ginkgo test) it cannot find the namespace label tenant on the namespace. (it is really there, believe me). Again the resources can be created, updated, patched deleted without any problem and the constraint works fine.
It looks to me that it cannot find the label here: not data.inventory.cluster.v1.Namespace[namespace].metadata.labels.tenant
Error:
message: 'cannot remove finalizer from claim: cannot update object: admission
webhook "validation.gatekeeper.sh" denied the request:
Namespace ''e2etest-e2etenantresources-r88tdp'' does not have a ''tenant'' label
in the parent namespace'
You are deleting the namespace? Wouldn't that delete any objects in the containing namespace? Are you applying this constraint against the DELETE operation?
G8r likely removes the namespace from the cache when the DELETE for the namespace is observed.
It looks like you are attempting to exempt DELETE, but the operation that is being blocked is an UPDATE that would remove the finalizer. Unfortunately, the K8s API has no way to remove finalizers other than via UPDATE and there is no way to easily ensure that the only thing being modified by an UPDATE is removal of the finalizer. I'd request that K8s implement some method for admission webhooks to detect/allow pure finalizer updates, as this occurrence is not uncommon.
In the interim, you could alter the template to allow the request if the namespace is missing from the cache altogether.
This issue 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.
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
We have the following constrainttemplate which works fine during create, update events. As soon as we keep the resource in the namespace and delete the whole namespace (like in ginkgo test) it cannot find the namespace label tenant on the namespace. (it is really there, believe me). Again the resources can be created, updated, patched deleted without any problem and the constraint works fine.
It looks to me that it cannot find the label here:
not data.inventory.cluster.v1.Namespace[namespace].metadata.labels.tenant
Error:
ConstraintTemplate:
What did you expect to happen:
It should not violate on the constraint.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
gatekeeper = {
chart = "gatekeeper",
name = "gatekeeper",
namespace = "gatekeeper-system",
repository = "https://open-policy-agent.github.io/gatekeeper/charts",
version = "3.15.1"
},
kubectl version
):Client Version: version.Info{Major:"1", Minor:"27",
Server Version: version.Info{Major:"1", Minor:"28+"
The text was updated successfully, but these errors were encountered: