From b7bf894fe9d9f602d75ad5753d540365259ffa4c Mon Sep 17 00:00:00 2001 From: Mariam Fahmy Date: Mon, 24 Jun 2024 18:54:57 +0700 Subject: [PATCH] chore: use v2 for exceptions in chainsaw tests (#10529) Signed-off-by: Mariam Fahmy --- .../commands/create/exception/command_test.go | 4 ++-- .../commands/create/templates/exception.yaml | 2 +- pkg/event/events.go | 2 +- pkg/validation/exception/validate_test.go | 8 ++++---- test/cli/test-exceptions/exceptions-1/exception.yaml | 2 +- test/cli/test-exceptions/exceptions-2/exception.yaml | 2 +- test/cli/test-exceptions/exceptions-3/exception.yaml | 2 +- .../apply/apply-exception-with-ns-selector/exception.yaml | 2 +- .../exceptions/allows-rejects-creation/exception.yaml | 2 +- .../chainsaw/exceptions/applies-to-delete/exception.yaml | 2 +- .../background-mode/standard/exception-allowed.yaml | 2 +- .../background-mode/standard/exception-rejected.yaml | 2 +- .../chainsaw/exceptions/conditions/exception.yaml | 2 +- .../events-creation/chainsaw-step-02-apply-2.yaml | 2 +- .../exceptions/exclude-capabilities/exception.yaml | 2 +- .../chainsaw/exceptions/exclude-host-ports/exception.yaml | 2 +- .../exception.yaml | 2 +- .../exceptions/exclude-hostpath-volume/exception.yaml | 2 +- .../exclude-privilege-escalation/exception.yaml | 2 +- .../exclude-privileged-containers/exception.yaml | 2 +- .../exclude-restricted-capabilities/exception.yaml | 2 +- .../exceptions/exclude-restricted-seccomp/exception.yaml | 2 +- .../exclude-running-as-nonroot-user/exception.yaml | 2 +- .../exceptions/exclude-running-as-nonroot/exception.yaml | 2 +- .../chainsaw/exceptions/exclude-seccomp/exception.yaml | 2 +- .../chainsaw/exceptions/exclude-selinux/exception.yaml | 2 +- .../chainsaw/exceptions/exclude-sysctls/exception.yaml | 2 +- .../exceptions/exclude-volume-types/exception.yaml | 2 +- .../exceptions/good-bad-conditions/failing-exception.yaml | 2 +- .../exceptions/good-bad-conditions/passing-exception.yaml | 2 +- .../exceptions/only-for-specific-user/exception.yaml | 2 +- .../chainsaw/exceptions/with-wildcard/exception.yaml | 2 +- .../skip-generate/cpol-with-exceptions/exception.yaml | 2 +- .../policy-exceptions-disabled/policy_exception.yaml | 2 +- .../chainsaw/reports/admission/exception/exception.yaml | 2 +- .../background/exception-with-conditions/exception.yaml | 2 +- .../background/exception-with-podsecurity/exception.yaml | 2 +- .../chainsaw/reports/background/exception/exception.yaml | 2 +- .../chainsaw-step-01-apply-1-4.yaml | 2 +- .../chainsaw-step-01-assert-1-3.yaml | 2 +- 40 files changed, 44 insertions(+), 44 deletions(-) diff --git a/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go b/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go index e177c733d9..d4f7143a57 100644 --- a/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go +++ b/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go @@ -40,7 +40,7 @@ func TestCommandWithAny(t *testing.T) { out, err := io.ReadAll(b) assert.NoError(t, err) expected := ` -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: test @@ -72,7 +72,7 @@ func TestCommandWithAll(t *testing.T) { out, err := io.ReadAll(b) assert.NoError(t, err) expected := ` -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: test diff --git a/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml b/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml index bdb65cc3a0..2e4f76188e 100644 --- a/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml +++ b/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: {{ .Name }} diff --git a/pkg/event/events.go b/pkg/event/events.go index 22f69967b6..9465ba8c6d 100644 --- a/pkg/event/events.go +++ b/pkg/event/events.go @@ -288,7 +288,7 @@ func NewPolicyExceptionEvents(engineResponse engineapi.EngineResponse, ruleResp func NewCleanupPolicyEvent(policy kyvernov2beta1.CleanupPolicyInterface, resource unstructured.Unstructured, err error) Info { regarding := corev1.ObjectReference{ // TODO: iirc it's not safe to assume api version is set - APIVersion: "kyverno.io/v2beta1", + APIVersion: "kyverno.io/v2", Kind: policy.GetKind(), Name: policy.GetName(), Namespace: policy.GetNamespace(), diff --git a/pkg/validation/exception/validate_test.go b/pkg/validation/exception/validate_test.go index e10e287403..a55e85a64c 100644 --- a/pkg/validation/exception/validate_test.go +++ b/pkg/validation/exception/validate_test.go @@ -26,7 +26,7 @@ func Test_Validate(t *testing.T) { Enabled: false, Namespace: "kyverno", }, - resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), + resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), }, want: 1, }, @@ -37,7 +37,7 @@ func Test_Validate(t *testing.T) { Enabled: true, Namespace: "kyverno", }, - resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), + resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), }, want: 1, }, @@ -48,7 +48,7 @@ func Test_Validate(t *testing.T) { Enabled: true, Namespace: "kyverno", }, - resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), + resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), }, want: 0, }, @@ -59,7 +59,7 @@ func Test_Validate(t *testing.T) { Enabled: true, Namespace: "", }, - resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), + resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`), }, want: 0, }, diff --git a/test/cli/test-exceptions/exceptions-1/exception.yaml b/test/cli/test-exceptions/exceptions-1/exception.yaml index cdd54d0130..93dd81a83c 100644 --- a/test/cli/test-exceptions/exceptions-1/exception.yaml +++ b/test/cli/test-exceptions/exceptions-1/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: delta-exception diff --git a/test/cli/test-exceptions/exceptions-2/exception.yaml b/test/cli/test-exceptions/exceptions-2/exception.yaml index e7a8ede127..4ab722cd7e 100644 --- a/test/cli/test-exceptions/exceptions-2/exception.yaml +++ b/test/cli/test-exceptions/exceptions-2/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: container-exception diff --git a/test/cli/test-exceptions/exceptions-3/exception.yaml b/test/cli/test-exceptions/exceptions-3/exception.yaml index b3c8ee87e5..48d534e711 100644 --- a/test/cli/test-exceptions/exceptions-3/exception.yaml +++ b/test/cli/test-exceptions/exceptions-3/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/cli/apply/apply-exception-with-ns-selector/exception.yaml b/test/conformance/chainsaw/cli/apply/apply-exception-with-ns-selector/exception.yaml index 0cb0d502a9..7272c3c687 100644 --- a/test/conformance/chainsaw/cli/apply/apply-exception-with-ns-selector/exception.yaml +++ b/test/conformance/chainsaw/cli/apply/apply-exception-with-ns-selector/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: exception diff --git a/test/conformance/chainsaw/exceptions/allows-rejects-creation/exception.yaml b/test/conformance/chainsaw/exceptions/allows-rejects-creation/exception.yaml index 3c5fd95b9b..ae94ec8390 100644 --- a/test/conformance/chainsaw/exceptions/allows-rejects-creation/exception.yaml +++ b/test/conformance/chainsaw/exceptions/allows-rejects-creation/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: mynewpolex diff --git a/test/conformance/chainsaw/exceptions/applies-to-delete/exception.yaml b/test/conformance/chainsaw/exceptions/applies-to-delete/exception.yaml index a9e5e9afb7..f0f3347fc5 100644 --- a/test/conformance/chainsaw/exceptions/applies-to-delete/exception.yaml +++ b/test/conformance/chainsaw/exceptions/applies-to-delete/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: delta-exception diff --git a/test/conformance/chainsaw/exceptions/background-mode/standard/exception-allowed.yaml b/test/conformance/chainsaw/exceptions/background-mode/standard/exception-allowed.yaml index 8e550cc2de..498f003c50 100644 --- a/test/conformance/chainsaw/exceptions/background-mode/standard/exception-allowed.yaml +++ b/test/conformance/chainsaw/exceptions/background-mode/standard/exception-allowed.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: polex-right diff --git a/test/conformance/chainsaw/exceptions/background-mode/standard/exception-rejected.yaml b/test/conformance/chainsaw/exceptions/background-mode/standard/exception-rejected.yaml index 94845c6e40..4f4e2aa240 100644 --- a/test/conformance/chainsaw/exceptions/background-mode/standard/exception-rejected.yaml +++ b/test/conformance/chainsaw/exceptions/background-mode/standard/exception-rejected.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: polex-wrong diff --git a/test/conformance/chainsaw/exceptions/conditions/exception.yaml b/test/conformance/chainsaw/exceptions/conditions/exception.yaml index e7a8ede127..4ab722cd7e 100644 --- a/test/conformance/chainsaw/exceptions/conditions/exception.yaml +++ b/test/conformance/chainsaw/exceptions/conditions/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: container-exception diff --git a/test/conformance/chainsaw/exceptions/events-creation/chainsaw-step-02-apply-2.yaml b/test/conformance/chainsaw/exceptions/events-creation/chainsaw-step-02-apply-2.yaml index 31e9e32f1d..e51e588938 100755 --- a/test/conformance/chainsaw/exceptions/events-creation/chainsaw-step-02-apply-2.yaml +++ b/test/conformance/chainsaw/exceptions/events-creation/chainsaw-step-02-apply-2.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: policy-exception-allow-latest diff --git a/test/conformance/chainsaw/exceptions/exclude-capabilities/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-capabilities/exception.yaml index 64cc01904a..d8f43f6262 100644 --- a/test/conformance/chainsaw/exceptions/exclude-capabilities/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-capabilities/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-host-ports/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-host-ports/exception.yaml index 3a3aa8b001..38563f16cc 100644 --- a/test/conformance/chainsaw/exceptions/exclude-host-ports/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-host-ports/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-host-process-and-host-namespaces/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-host-process-and-host-namespaces/exception.yaml index 989c1cc748..9cd2c51df8 100644 --- a/test/conformance/chainsaw/exceptions/exclude-host-process-and-host-namespaces/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-host-process-and-host-namespaces/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-hostpath-volume/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-hostpath-volume/exception.yaml index 65397c40dd..d1ddc7b79d 100644 --- a/test/conformance/chainsaw/exceptions/exclude-hostpath-volume/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-hostpath-volume/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-privilege-escalation/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-privilege-escalation/exception.yaml index 52ced416e4..feede38bfd 100644 --- a/test/conformance/chainsaw/exceptions/exclude-privilege-escalation/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-privilege-escalation/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-privileged-containers/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-privileged-containers/exception.yaml index 85488ca435..33634cec37 100644 --- a/test/conformance/chainsaw/exceptions/exclude-privileged-containers/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-privileged-containers/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-restricted-capabilities/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-restricted-capabilities/exception.yaml index 128a7df339..ab15bdd465 100644 --- a/test/conformance/chainsaw/exceptions/exclude-restricted-capabilities/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-restricted-capabilities/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-restricted-seccomp/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-restricted-seccomp/exception.yaml index 880f54a86b..007fda3f07 100644 --- a/test/conformance/chainsaw/exceptions/exclude-restricted-seccomp/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-restricted-seccomp/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot-user/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot-user/exception.yaml index da3b1d1283..f1a7629947 100644 --- a/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot-user/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot-user/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot/exception.yaml index aa3f87460d..8d5c4446cb 100644 --- a/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-running-as-nonroot/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-seccomp/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-seccomp/exception.yaml index c7780afa97..3318fcf531 100644 --- a/test/conformance/chainsaw/exceptions/exclude-seccomp/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-seccomp/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-selinux/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-selinux/exception.yaml index ebf95b7570..bcc2cd8f74 100644 --- a/test/conformance/chainsaw/exceptions/exclude-selinux/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-selinux/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-sysctls/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-sysctls/exception.yaml index ed00705ef3..1258d46eba 100644 --- a/test/conformance/chainsaw/exceptions/exclude-sysctls/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-sysctls/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/exclude-volume-types/exception.yaml b/test/conformance/chainsaw/exceptions/exclude-volume-types/exception.yaml index 45b096a512..b718809ca0 100644 --- a/test/conformance/chainsaw/exceptions/exclude-volume-types/exception.yaml +++ b/test/conformance/chainsaw/exceptions/exclude-volume-types/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/exceptions/good-bad-conditions/failing-exception.yaml b/test/conformance/chainsaw/exceptions/good-bad-conditions/failing-exception.yaml index abcebda909..9fd478d9f4 100644 --- a/test/conformance/chainsaw/exceptions/good-bad-conditions/failing-exception.yaml +++ b/test/conformance/chainsaw/exceptions/good-bad-conditions/failing-exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: failing-container-exception diff --git a/test/conformance/chainsaw/exceptions/good-bad-conditions/passing-exception.yaml b/test/conformance/chainsaw/exceptions/good-bad-conditions/passing-exception.yaml index 8d3323cbaa..a0c3ec4a3f 100644 --- a/test/conformance/chainsaw/exceptions/good-bad-conditions/passing-exception.yaml +++ b/test/conformance/chainsaw/exceptions/good-bad-conditions/passing-exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: passing-container-exception diff --git a/test/conformance/chainsaw/exceptions/only-for-specific-user/exception.yaml b/test/conformance/chainsaw/exceptions/only-for-specific-user/exception.yaml index b5beaf8848..0f2efbdc1c 100644 --- a/test/conformance/chainsaw/exceptions/only-for-specific-user/exception.yaml +++ b/test/conformance/chainsaw/exceptions/only-for-specific-user/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: mynewpolex diff --git a/test/conformance/chainsaw/exceptions/with-wildcard/exception.yaml b/test/conformance/chainsaw/exceptions/with-wildcard/exception.yaml index 9ded4a7449..7c5b688d46 100644 --- a/test/conformance/chainsaw/exceptions/with-wildcard/exception.yaml +++ b/test/conformance/chainsaw/exceptions/with-wildcard/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: mynewpolex diff --git a/test/conformance/chainsaw/generate-validating-admission-policy/clusterpolicy/standard/skip-generate/cpol-with-exceptions/exception.yaml b/test/conformance/chainsaw/generate-validating-admission-policy/clusterpolicy/standard/skip-generate/cpol-with-exceptions/exception.yaml index 43c75ab45b..c4e61e5378 100644 --- a/test/conformance/chainsaw/generate-validating-admission-policy/clusterpolicy/standard/skip-generate/cpol-with-exceptions/exception.yaml +++ b/test/conformance/chainsaw/generate-validating-admission-policy/clusterpolicy/standard/skip-generate/cpol-with-exceptions/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: policy-exception diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy_exception.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy_exception.yaml index 8b1026d3a0..9c8b6531f9 100644 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy_exception.yaml +++ b/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy_exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: label-exception diff --git a/test/conformance/chainsaw/reports/admission/exception/exception.yaml b/test/conformance/chainsaw/reports/admission/exception/exception.yaml index 3c5fd95b9b..ae94ec8390 100644 --- a/test/conformance/chainsaw/reports/admission/exception/exception.yaml +++ b/test/conformance/chainsaw/reports/admission/exception/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: mynewpolex diff --git a/test/conformance/chainsaw/reports/background/exception-with-conditions/exception.yaml b/test/conformance/chainsaw/reports/background/exception-with-conditions/exception.yaml index 87cba12d24..4c388896ba 100644 --- a/test/conformance/chainsaw/reports/background/exception-with-conditions/exception.yaml +++ b/test/conformance/chainsaw/reports/background/exception-with-conditions/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: container-exception diff --git a/test/conformance/chainsaw/reports/background/exception-with-podsecurity/exception.yaml b/test/conformance/chainsaw/reports/background/exception-with-podsecurity/exception.yaml index 74a017020b..0fffbed031 100644 --- a/test/conformance/chainsaw/reports/background/exception-with-podsecurity/exception.yaml +++ b/test/conformance/chainsaw/reports/background/exception-with-podsecurity/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: pod-security-exception diff --git a/test/conformance/chainsaw/reports/background/exception/exception.yaml b/test/conformance/chainsaw/reports/background/exception/exception.yaml index 54a997c350..fa60bad8a9 100644 --- a/test/conformance/chainsaw/reports/background/exception/exception.yaml +++ b/test/conformance/chainsaw/reports/background/exception/exception.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: mynewpolex diff --git a/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-apply-1-4.yaml b/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-apply-1-4.yaml index f936108985..86b6844742 100755 --- a/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-apply-1-4.yaml +++ b/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-apply-1-4.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: allow-scaling-nginx-test diff --git a/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-assert-1-3.yaml b/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-assert-1-3.yaml index f936108985..86b6844742 100755 --- a/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-assert-1-3.yaml +++ b/test/conformance/chainsaw/validate/clusterpolicy/standard/enforce/bypass-with-policy-exception/chainsaw-step-01-assert-1-3.yaml @@ -1,4 +1,4 @@ -apiVersion: kyverno.io/v2beta1 +apiVersion: kyverno.io/v2 kind: PolicyException metadata: name: allow-scaling-nginx-test