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

redo changes reverted by merge #1526

Merged
merged 2 commits into from Feb 2, 2021
Merged

Conversation

JimBugwadia
Copy link
Member

Signed-off-by: Jim Bugwadia jim@nirmata.com

Related issue

These changes somehow got missed in the last PR....when I merged.

What type of PR is this?

Proposed changes

Checklist

Further comments

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
@@ -81,6 +81,9 @@ func filterRule(rule kyverno.Rule, policyContext *PolicyContext) *response.RuleR
return nil
}

policyContext.JSONContext.Checkpoint()
defer policyContext.JSONContext.Restore()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on why we need to copy/restore context per rule?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each rule can have separate variables in the context. For example, if a rule loads a config map, it is meant to be used as part of processing that rule and should not be available to subsequent rules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each rule can have separate variables in the context. For example, if a rule loads a config map, it is meant to be used as part of processing that rule and should not be available to subsequent rules.

@JimBugwadia JimBugwadia merged commit f247892 into main Feb 2, 2021
@JimBugwadia JimBugwadia deleted the feature/api_server_lookups_2 branch February 2, 2021 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants