[go: up one dir, main page]

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

fix: no skip result when no image match the rule #6733

Merged
merged 4 commits into from
Mar 30, 2023

Conversation

eddycharly
Copy link
Member

Explanation

This PR removes skip results when no image match the rule.

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
@realshuting
Copy link
Member

The unit tests failed @eddycharly :(

@eddycharly
Copy link
Member Author

Yeah, will fix it asap.

@eddycharly
Copy link
Member Author

@realshuting does the changes make sense ?

@realshuting
Copy link
Member

@realshuting does the changes make sense ?

I'll probably have to defer it to @JimBugwadia , it was added via #6011. Not sure if we do this on purpose?

@eddycharly
Copy link
Member Author

@JimBugwadia WDYT ?

@eddycharly
Copy link
Member Author

My use case is to validate all registry.k8s.io/* images, it works but all other images now have a skip result, i expected that those other images are not considered at all because they don't match the image references i'm targeting.

@realshuting
Copy link
Member

My use case is to validate all registry.k8s.io/* images, it works but all other images now have a skip result, i expected that those other images are not considered at all because they don't match the image references i'm targeting.

Makes sense to me.

all other images now have a skip result

How does this impact users? Does Kyverno return skipped images in the message when an image is blocked?

@eddycharly
Copy link
Member Author

How does this impact users?

At least this creates a report with a skipped entry in it.
I might be missing something but as long as the image doesn't match why do we continue processing the rule ?

@realshuting
Copy link
Member

How does this impact users?

At least this creates a report with a skipped entry in it. I might be missing something but as long as the image doesn't match why do we continue processing the rule ?

I agree, there seems no need to have these skipped results in the report. I thought skip is only used when the precondition doesn't match.

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 Mar 30, 2023

Codecov Report

Merging #6733 (23aec16) into main (eaaa8a0) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #6733      +/-   ##
==========================================
- Coverage   34.36%   34.33%   -0.03%     
==========================================
  Files         215      215              
  Lines       21034    21025       -9     
==========================================
- Hits         7228     7219       -9     
  Misses      13109    13109              
  Partials      697      697              
Impacted Files Coverage Δ
pkg/engine/imageVerify.go 74.00% <100.00%> (-2.15%) ⬇️

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

@JimBugwadia
Copy link
Member

The intent of Skip was to indicate that a rule matches but was not applied due to some other filter, like preconditions or image patterns.

What is the proposed behavior for Skip? Seems like the same argument for removing it for image matches can be applied to preconditions.

@eddycharly
Copy link
Member Author

But in this case we have no way to target specific image patterns ? It's going to generate a lot of skip events.
Given that we can't match/exclude on image patterns, how can we make things better ?

@JimBugwadia
Copy link
Member

Yes, that's true.

We can remove this, as I don't see much value in reporting Skip other than perhaps troubleshooting policies, which is not the intent of the report.

@eddycharly eddycharly enabled auto-merge (squash) March 30, 2023 14:57
@chipzoller
Copy link
Contributor

FWIW I agree here with the decision to not score non-matching images as a Skip result.

@eddycharly eddycharly merged commit 94f0829 into kyverno:main Mar 30, 2023
@eddycharly eddycharly deleted the image-verify-no-match branch March 30, 2023 16:57
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.

4 participants