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

refactor: make policy context immutable and fields private #5523

Merged
merged 7 commits into from
Dec 2, 2022

Conversation

eddycharly
Copy link
Member

Explanation

This PR makes policy context immutable and fields private.

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
eddycharly and others added 3 commits December 1, 2022 14:03
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
@codecov
Copy link

codecov bot commented Dec 1, 2022

Codecov Report

Merging #5523 (c00fad0) into main (d7c7bbc) will decrease coverage by 0.15%.
The diff coverage is 34.84%.

@@            Coverage Diff             @@
##             main    #5523      +/-   ##
==========================================
- Coverage   36.52%   36.36%   -0.16%     
==========================================
  Files         171      171              
  Lines       19238    19261      +23     
==========================================
- Hits         7026     7005      -21     
- Misses      11416    11460      +44     
  Partials      796      796              
Impacted Files Coverage Δ
pkg/background/generate/generate.go 0.00% <0.00%> (ø)
pkg/cosign/client.go 50.00% <ø> (ø)
pkg/engine/background.go 0.00% <0.00%> (ø)
pkg/engine/generation.go 0.00% <0.00%> (ø)
pkg/engine/imageVerifyValidate.go 11.25% <0.00%> (ø)
pkg/policy/apply.go 0.00% <0.00%> (ø)
pkg/webhooks/resource/generation/generation.go 0.00% <0.00%> (ø)
pkg/webhooks/utils/policy_context_builder.go 0.00% <0.00%> (ø)
pkg/engine/policyContext.go 2.15% <2.19%> (-97.85%) ⬇️
pkg/webhooks/resource/updaterequest.go 17.07% <14.28%> (+1.68%) ⬆️
... and 12 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines -511 to -513
ExcludeGroupRole: []string{},
ExcludeResourceFunc: func(s1, s2, s3 string) bool {
return false
Copy link
Member

Choose a reason for hiding this comment

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

What are these two vars? Doesn't seem to be needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean ?
This code was removed.

Copy link
Member

Choose a reason for hiding this comment

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

Just questioning why they were added before, nothing to change :)

pkg/background/common/context.go Show resolved Hide resolved
pkg/policy/apply.go Show resolved Hide resolved
@realshuting realshuting self-assigned this Dec 2, 2022
@realshuting realshuting merged commit 5b89e2e into kyverno:main Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants