1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 01:46:55 +00:00
kyverno/test/scenarios/samples/best_practices/add_networkPolicy.yaml
Valentin Velkov 63f4c9a884
Configurable success events on policies & resources. Generating failure events on policies by default. (#1939)
* Remove unused event.Reason const

Signed-off-by: Velkov <valentin.velkov@sap.com>

* Generate failure events on policies

Signed-off-by: Velkov <valentin.velkov@sap.com>

* Generate success events on policy

Signed-off-by: Velkov <valentin.velkov@sap.com>

* Introduce 'generateSuccessEvents' flag

Signed-off-by: Velkov <valentin.velkov@sap.com>

* Unit tests & chart fix

Signed-off-by: Velkov <valentin.velkov@sap.com>
2021-06-29 14:43:11 -07:00

24 lines
674 B
YAML

# file path relative to project root
input:
policy: test/best_practices/add_network_policy.yaml
resource: test/resources/require_default_network_policy.yaml
expected:
generation:
generatedResources:
- name: default-deny-ingress
kind: NetworkPolicy
namespace: devtest
policyresponse:
policy:
namespace: ''
name: add-networkpolicy
resource:
kind: Namespace
apiVersion: v1
namespace: ''
name: devtest
rules:
- name: default-deny-ingress
type: Generation
success: true
message: created resource NetworkPolicy/devtest/default-deny-ingress