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

doc: apply policy exceptions after executing the policy itself #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions proposals/allow_policy_exception.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,17 @@ Due to the autogen machanism of kyverno, users may need to specify additional ru

## Implementation Notes

We will introduce a new CRD: `PolicyException`.
1. We will introduce a new CRD: `PolicyException`.

Kyverno would check if there is a matching `PolicyException` when validate / mutate / generate / imageVerify for each rule.
2. Kyverno would check if there is a matching `PolicyException` when validate / mutate / generate / imageVerify for each rule.

If there is a matching exception, the rule status would be set as `skip` when building the rule response.
- If there is a matching exception, the rule status would be set as `skip` when building the rule response.

If there is no matching exception, the rule response would be nil.
- If there is no matching exception, the rule response would be nil.

If there is an error, the rule status would be set as `error` and report.
- If there is an error, the rule status would be set as `error` and report.

3. Policy Exceptions will be applied after applying the cluster/namespaced policies to the resource in case rule response has a status of `fail` since there are some cases where applying the policy rule as an initial step is essential to do the exclusion afterwards such as `validate.podSecurity` rule.

## Alternative Solution

Expand Down