This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
Change failurePolicy to "Fail" and add reinvocationPolicy "IfNeeded" #265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR changes two things:
Ignore
toFail
. I argue that it might be problematic if the Karydia webhook fails silently. It should rather fail and throw an error. Also seeFailurePolicy
considerations #2https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#failure-policy
2. It sets the reinvocationPolicy to
IfNeeded
. Thus, the webhook may be called if the object being admitted is modified by other webhooks after the initial webhook call. For example, if the Karydia webhook is invoked for an object and modifies it, another webhook could modify it later on, then the Karydia webhook should be called again to enforce the security policies.(For me it seems like this scenario is limited in the number of calls if changes appears on an already mutated object. See kubernetes/enhancements#1049).
https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#reinvocation-policy
Checklist
Before submitting this PR, please make sure:
make
make test