1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

change anypattern to pattern, refer

This commit is contained in:
Shuting Zhao 2019-10-01 14:45:16 -07:00
parent a620c14c58
commit 5009e8abb7
4 changed files with 12 additions and 12 deletions

View file

@ -11,9 +11,9 @@ spec:
- Pod - Pod
validate: validate:
message: "A none 'default' namespace is required" message: "A none 'default' namespace is required"
anyPattern: pattern:
- metadata: metadata:
namespace: "!default" namespace: "!default"
- name: check-namespace-exist - name: check-namespace-exist
match: match:
resources: resources:
@ -21,6 +21,6 @@ spec:
- Pod - Pod
validate: validate:
message: "A namespace is required" message: "A namespace is required"
anyPattern: pattern:
- metadata: metadata:
namespace: "?*" namespace: "?*"

View file

@ -15,8 +15,8 @@ spec:
- Pod - Pod
validate: validate:
message: "Container should not have read-only rootfilesystem" message: "Container should not have read-only rootfilesystem"
anyPattern: pattern:
- spec: spec:
container: containers:
- securityContext: - securityContext:
readOnlyRootFilesystem: false readOnlyRootFilesystem: false

View file

@ -16,10 +16,10 @@ expected:
rules: rules:
- name: check-default-namespace - name: check-default-namespace
type: Validation type: Validation
message: "Validation rule 'check-default-namespace' failed to validate patterns defined in anyPattern. A none 'default' namespace is required; anyPattern[0] failed at path /metadata/namespace/" message: "Validation rule 'check-default-namespace' failed at '/metadata/namespace/' for resource Pod/default/myapp-pod. A none 'default' namespace is required"
success: false success: false
- name: check-namespace-exist - name: check-namespace-exist
type: Validation type: Validation
message: "Validation rule 'check-namespace-exist' anyPattern[0] succesfully validated" message: "Validation rule 'check-namespace-exist' succesfully validated"
success: true success: true

View file

@ -14,5 +14,5 @@ expected:
rules: rules:
- name: validate-not-readonly-rootfilesystem - name: validate-not-readonly-rootfilesystem
type: Validation type: Validation
message: Validation rule 'validate-not-readonly-rootfilesystem' failed to validate patterns defined in anyPattern. Container should not have read-only rootfilesystem; anyPattern[0] failed at path /spec/container/ message: Validation rule 'validate-not-readonly-rootfilesystem' failed at '/spec/containers/0/securityContext/readOnlyRootFilesystem/' for resource Pod//ghost-with-readonly-rootfilesystem. Container should not have read-only rootfilesystem
success: false success: false