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.
Merge branch 'release-1.10' into release-1.10
- Loading branch information
Showing
15 changed files
with
227 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
--- | ||
webhooksCleanup: | ||
enable: true | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 1 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/component | ||
operator: In | ||
values: | ||
- hooks | ||
topologyKey: kubernetes.io/hostname |
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,9 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{- define "kyverno.cleanup.labels" -}} | ||
{{- template "kyverno.labels.merge" (list | ||
(include "kyverno.labels.common" .) | ||
(include "kyverno.matchLabels.common" .) | ||
(include "kyverno.labels.component" "cleanup") | ||
) -}} | ||
{{- end -}} |
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
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
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
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
42 changes: 42 additions & 0 deletions
42
test/conformance/kuttl/policy-validation/cluster-policy/schema-validation-crd/01-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,42 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
annotations: | ||
policies.kyverno.io/category: Security | ||
policies.kyverno.io/description: 'This policy mutates any namespace-scoped Custom | ||
Resource Definition created by the subjects in the xteam Azure AD group | ||
and adds the label "createdByXteam: true".' | ||
policies.kyverno.io/subject: RBAC | ||
policies.kyverno.io/title: Mutate Namespace-Scoped CRDs for xteam aad | ||
group | ||
policy.reporter.kyverno.io/minimal: minimal | ||
generation: 1 | ||
labels: | ||
aws.cdk.eks/prune-c8b5941ff5f4fe911c5ee96472fda3d1f9866734a7: "" | ||
name: mutate-xteam-namespace-scoped-crds | ||
spec: | ||
background: false | ||
rules: | ||
- match: | ||
all: | ||
- resources: | ||
kinds: | ||
- CustomResourceDefinition | ||
subjects: | ||
- kind: Group | ||
name: aad:9b9had99-6k66-2222-9999-8aadb888e888 | ||
mutate: | ||
patchStrategicMerge: | ||
metadata: | ||
labels: | ||
createdByXteam: "true" | ||
name: mutate-xteams-crd-creation | ||
preconditions: | ||
all: | ||
- key: '{{request.operation}}' | ||
operator: Equals | ||
value: CREATE | ||
- key: '{{ request.object.spec.scope }}' | ||
operator: Equals | ||
value: Namespaced | ||
validationFailureAction: audit |
11 changes: 11 additions & 0 deletions
11
...formance/kuttl/policy-validation/cluster-policy/schema-validation-crd/README.md
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,11 @@ | ||
## Description | ||
|
||
This test ensures the schema validation is skipped for CustomResourceDefinition. | ||
|
||
## Expected Behavior | ||
|
||
The Pod creation should be allowed. | ||
|
||
## Reference Issue(s) | ||
|
||
https://github.com/kyverno/kyverno/issues/7844 |
9 changes: 9 additions & 0 deletions
9
...nformance/kuttl/policy-validation/cluster-policy/schema-validation-crd/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,9 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: mutate-xteam-namespace-scoped-crds | ||
status: | ||
conditions: | ||
- reason: Succeeded | ||
status: "True" | ||
type: Ready |