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

Infra 39554: Update make kyverno/test to use PolicyExceptions #198

Merged
merged 5 commits into from
Feb 19, 2025

Conversation

nabadger
Copy link
Contributor

@nabadger nabadger commented Feb 14, 2025

This MR requires the latest version of kyverno-cli (tested against 1.13.4)

It allows make kyverno/test to be run locally (and in CI), without the need for deploying a k3d/kind cluster (so speeds up jobs).

kyverno-cli now supports passing through --exceptions which means this helper can be run locally.

The change is:

  1. Patch ClusterPolicy manifests to remove the .metadata.namespace field. This is an issue with how we generated the rendered manifests with Tanka. This previously was not an issue as the tests were run in a k8s cluster. It's an issue now as the policies do not match as they are namespaced (probably a bug in kyverno...)
  2. Combine yaml where required to avoid the need for extra loops
  3. Update kyverno apply to pass in --exceptions and also configure the output to --table

@nabadger nabadger marked this pull request as draft February 14, 2025 10:15
@nabadger nabadger changed the title Infra 39554: Update make kyvern/test to use PolicyExceptions Infra 39554: Update make kyverno/test to use PolicyExceptions Feb 19, 2025
@nabadger nabadger marked this pull request as ready for review February 19, 2025 11:41
@nabadger nabadger merged commit 12e9185 into main Feb 19, 2025
2 checks passed
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.

3 participants