diff --git a/examples/best_practices/policy_validate_default_namespace.yaml b/examples/best_practices/policy_validate_default_namespace.yaml index e77dc7394a..1882f36413 100644 --- a/examples/best_practices/policy_validate_default_namespace.yaml +++ b/examples/best_practices/policy_validate_default_namespace.yaml @@ -11,9 +11,9 @@ spec: - Pod validate: message: "A none 'default' namespace is required" - anyPattern: - - metadata: - namespace: "!default" + pattern: + metadata: + namespace: "!default" - name: check-namespace-exist match: resources: @@ -21,6 +21,6 @@ spec: - Pod validate: message: "A namespace is required" - anyPattern: - - metadata: - namespace: "?*" + pattern: + metadata: + namespace: "?*" diff --git a/examples/best_practices/policy_validate_not_readonly_rootfilesystem.yaml b/examples/best_practices/policy_validate_not_readonly_rootfilesystem.yaml index a0085cb014..f441a3ff98 100644 --- a/examples/best_practices/policy_validate_not_readonly_rootfilesystem.yaml +++ b/examples/best_practices/policy_validate_not_readonly_rootfilesystem.yaml @@ -15,8 +15,8 @@ spec: - Pod validate: message: "Container should not have read-only rootfilesystem" - anyPattern: - - spec: - container: + pattern: + spec: + containers: - securityContext: readOnlyRootFilesystem: false \ No newline at end of file diff --git a/test/scenarios/test/scenario_validate_default_namespace.yaml b/test/scenarios/test/scenario_validate_default_namespace.yaml index aec3c79221..ee68253560 100644 --- a/test/scenarios/test/scenario_validate_default_namespace.yaml +++ b/test/scenarios/test/scenario_validate_default_namespace.yaml @@ -16,10 +16,10 @@ expected: rules: - name: check-default-namespace 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 - name: check-namespace-exist type: Validation - message: "Validation rule 'check-namespace-exist' anyPattern[0] succesfully validated" + message: "Validation rule 'check-namespace-exist' succesfully validated" success: true diff --git a/test/scenarios/test/scenario_validate_not_readonly_rootfilesystem.yaml b/test/scenarios/test/scenario_validate_not_readonly_rootfilesystem.yaml index d523092818..74bf0a5d22 100644 --- a/test/scenarios/test/scenario_validate_not_readonly_rootfilesystem.yaml +++ b/test/scenarios/test/scenario_validate_not_readonly_rootfilesystem.yaml @@ -14,5 +14,5 @@ expected: rules: - name: validate-not-readonly-rootfilesystem 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 \ No newline at end of file