mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 17:37:12 +00:00
|
||
---|---|---|
.. | ||
bad-resources.yaml | ||
chainsaw-test.yaml | ||
good-resources.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