1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/test/conformance/chainsaw/reports/background/two-rules-with-different-modes
Charles-Edouard Brétéché decb7524eb
chore: use more chainsaw step templates (#11308)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-03 13:53:14 +03:00
..
bad-resources.yaml fix: return policies with either audit or enforce rules from the cache (#10667) 2024-08-06 18:24:28 +00:00
chainsaw-test.yaml chore: use more chainsaw step templates (#11308) 2024-10-03 13:53:14 +03:00
good-resources.yaml fix: return policies with either audit or enforce rules from the cache (#10667) 2024-08-06 18:24:28 +00:00
policy.yaml chore: rename validationFailureAction to failureAction under the rule (#10893) 2024-08-27 20:07:57 +00:00
README.md fix: return policies with either audit or enforce rules from the cache (#10667) 2024-08-06 18:24:28 +00:00
reports-assert.yaml fix: return policies with either audit or enforce rules from the cache (#10667) 2024-08-06 18:24:28 +00:00

Description

This test ensures that reports are generated as a result of background scanning when a policy with two rules with different modes is applied on resources.

Expected Behavior

  1. Create a good-ns-1 namespace that has the purpose label.

  2. Create a good-ns-2 namespace that has both the purpose and environment labels.

  3. Create a bad-ns-1 namespace that doesn't have the purpose label.

  4. Create a bad-ns-2 namespace that doesn't have any labels.

  5. Create a policy that has two rules:

    • The first rule is require-ns-purpose-label in the Enforce mode that requires the purpose label to be set on namespaces.
    • The second rule is require-ns-env-label in the Audit mode that requires the environment field to be set on namespaces.
  6. Four ClusterPolicyReports will be created for each of the good-ns-1, good-ns-2, bad-ns-1, and bad-ns-2 namespaces.

Reference Issue(s)

#10682