Skip to content

policy: Handle pass rules during enforcement#1904

Open
jrajahalme wants to merge 2 commits into
mainfrom
pass-during-enforcement
Open

policy: Handle pass rules during enforcement#1904
jrajahalme wants to merge 2 commits into
mainfrom
pass-during-enforcement

Conversation

@jrajahalme
Copy link
Copy Markdown
Member

Handle pass rules during enforcement by skipping past the passed-over
rules when a rule with a pass verdict matches. This is more
straightforward and gets rid of precedence promotion altogether, which
is made possible by the duplication of wildcard-port rules into the
port-specific rulesets, as after that change there is no need to compare
precedences between multiple lookups. Since there is no transformation on
the rules, the applied rules have the same shape as the imported policy,
which makes debugging easier. The implementation skips over the
passed-over rules without scanning all of them so the performance should
be similar to the previous implementation.

Leave enough space after the pass verdict for all the passed rules to fit
in before the following rules on the same tier. This is the requirement
of the current API for correct behavior.

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Handle pass rules during enforcement by skipping past the passed-over
rules when a rule with a pass verdict matches. This is more
straightforward and gets rid of precedence promotioin altogether, which
is made possible by the duplication of wildcard-port rules into the
port-specific rulesets, as after that change there is no need to compare
precedences between multiple lookups. Since there is no transformation on
the rules, the applied rules have the same shape as the imported policy,
which makes debugging easier. The implementation skips over the
passed-over rules without scanning all of them so the performance should
be similar to the previous implementation.

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
@jrajahalme jrajahalme requested a review from a team as a code owner May 17, 2026 14:47
@jrajahalme jrajahalme requested a review from sayboras May 17, 2026 14:47
@jrajahalme jrajahalme added clean-up Changes not affecting release behavior (style, removal of deprecated or dead code) needs-backport/1.36 labels May 17, 2026
@jrajahalme jrajahalme mentioned this pull request May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean-up Changes not affecting release behavior (style, removal of deprecated or dead code) needs-backport/1.36

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant