open-policy-agent / gatekeeper

🐊 Gatekeeper - Policy Controller for Kubernetes
https://open-policy-agent.github.io/gatekeeper/
Apache License 2.0
3.72k stars 765 forks source link

feat: support expansion in gator verify #3650

Closed David-Jaeyoon-Lee closed 2 weeks ago

David-Jaeyoon-Lee commented 1 month ago

What this PR does / why we need it: It allows for expansion in gator verify.

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged): Fixes #3432

Special notes for your reviewer:

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 50.74627% with 33 lines in your changes missing coverage. Please review.

Project coverage is 47.72%. Comparing base (3350319) to head (996608e). Report is 192 commits behind head on master.

Files with missing lines Patch % Lines
pkg/gator/verify/runner.go 59.64% 16 Missing and 7 partials :warning:
pkg/gator/reader/read_resources.go 0.00% 10 Missing :warning:

:exclamation: There is a different number of reports uploaded between BASE (3350319) and HEAD (996608e). Click for more details.

HEAD has 1 upload less than BASE | Flag | BASE (3350319) | HEAD (996608e) | |------|------|------| |unittests|2|1|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3650 +/- ## ========================================== - Coverage 54.49% 47.72% -6.78% ========================================== Files 134 236 +102 Lines 12329 19846 +7517 ========================================== + Hits 6719 9471 +2752 - Misses 5116 9485 +4369 - Partials 494 890 +396 ``` | [Flag](https://app.codecov.io/gh/open-policy-agent/gatekeeper/pull/3650/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-policy-agent) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/open-policy-agent/gatekeeper/pull/3650/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-policy-agent) | `47.72% <50.74%> (-6.78%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-policy-agent#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JaydipGabani commented 1 month ago

Are we going to add expannsionTemplate to suite?

David-Jaeyoon-Lee commented 4 weeks ago

@David-Jaeyoon-Lee LGTM after gator tests are modified for expansion template, this might help adding those tests David-Jaeyoon-Lee#2.

I think I added similar tests in this pr already. Or am I misunderstanding something? What specifically do we want to modify?

Edit: Nevermind I see

JaydipGabani commented 3 weeks ago

@David-Jaeyoon-Lee you will probably need to update docs as well to let users know how to use this. This is probably the best place to include that information - https://open-policy-agent.github.io/gatekeeper/website/docs/gator#the-gator-verify-subcommand.

I am ok with a follow up PR to update the docs. @maxsmythe @ritazh @sozercan wdyt?

malexander2012 commented 6 days ago

Thank you to all who were involved in making this happen!