mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 01:46:55 +00:00
* chore: bump chainsaw * more template use * v0.2.10 * go mod --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> |
||
---|---|---|
.. | ||
bad-resources.yaml | ||
chainsaw-test.yaml | ||
good-resources.yaml | ||
policy-assert.yaml | ||
policy.yaml | ||
README.md | ||
reports-assert.yaml |
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
-
Create a
good-ns-1
namespace that has thepurpose
label. -
Create a
good-ns-2
namespace that has both thepurpose
andenvironment
labels. -
Create a
bad-ns-1
namespace that doesn't have thepurpose
label. -
Create a
bad-ns-2
namespace that doesn't have any labels. -
Create a policy that has two rules:
- The first rule is
require-ns-purpose-label
in theEnforce
mode that requires thepurpose
label to be set on namespaces. - The second rule is
require-ns-env-label
in theAudit
mode that requires theenvironment
field to be set on namespaces.
- The first rule is
-
Four ClusterPolicyReports will be created for each of the
good-ns-1
,good-ns-2
,bad-ns-1
, andbad-ns-2
namespaces.
Reference Issue(s)
#10682