forked from kyverno/kyverno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: skip generating VAPs in case namespace's name contains wildcards (…
…kyverno#10205) Signed-off-by: Mariam Fahmy <[email protected]>
- Loading branch information
1 parent
6fec524
commit 900bf48
Showing
7 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ard/skip-generate/cpol-any-match-resources-in-namespaces-with-wildcard/chainsaw-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
creationTimestamp: null | ||
name: cpol-any-match-resources-in-namespaces-with-wildcard | ||
spec: | ||
steps: | ||
- name: step-01 | ||
try: | ||
- apply: | ||
file: policy.yaml | ||
- assert: | ||
file: policy-assert.yaml | ||
- name: step-02 | ||
try: | ||
- error: | ||
file: validatingadmissionpolicy.yaml | ||
- error: | ||
file: validatingadmissionpolicybinding.yaml |
12 changes: 12 additions & 0 deletions
12
...ard/skip-generate/cpol-any-match-resources-in-namespaces-with-wildcard/policy-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: check-label-app-5 | ||
status: | ||
conditions: | ||
- reason: Succeeded | ||
status: "True" | ||
type: Ready | ||
validatingadmissionpolicy: | ||
generated: false | ||
|
20 changes: 20 additions & 0 deletions
20
...y/standard/skip-generate/cpol-any-match-resources-in-namespaces-with-wildcard/policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: check-label-app-5 | ||
spec: | ||
validationFailureAction: Audit | ||
rules: | ||
- name: check-label-app | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Pod | ||
namespaces: | ||
- "prod-*" | ||
- "staging" | ||
validate: | ||
cel: | ||
expressions: | ||
- expression: "'app' in object.metadata.labels" |
7 changes: 7 additions & 0 deletions
7
...erate/cpol-any-match-resources-in-namespaces-with-wildcard/validatingadmissionpolicy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: admissionregistration.k8s.io/v1alpha1 | ||
kind: ValidatingAdmissionPolicy | ||
metadata: | ||
labels: | ||
app.kubernetes.io/managed-by: kyverno | ||
name: check-label-app-5 | ||
spec: {} |
7 changes: 7 additions & 0 deletions
7
...pol-any-match-resources-in-namespaces-with-wildcard/validatingadmissionpolicybinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: admissionregistration.k8s.io/v1alpha1 | ||
kind: ValidatingAdmissionPolicyBinding | ||
metadata: | ||
labels: | ||
app.kubernetes.io/managed-by: kyverno | ||
name: check-label-app-5-binding | ||
spec: {} |