Kyverno policy CI bug fixes
Two tests:
- Mattermost, non-debug: https://repo1.dso.mil/platform-one/big-bang/pipeline-templates/package-validation/-/jobs/17769631
- Podinfo, debug: https://repo1.dso.mil/platform-one/big-bang/pipeline-templates/package-validation/-/jobs/17769637
Changes in this MR:
- Adds verbose mode to
kyverno apply
when DEBUG is on - Captures exit code of
kyverno apply
rather than exiting immediately: this allows us to run all policy checks and output results before failing - DRYs up the logic around testing default values (moves out of the if/else since we always run this)
- Adjusts the find command and logic around detecting policies to ensure we remove non-policy files (prevents random warnings)
- Adds default values check for package specific policies
Edited by Micah Nagel