The test suite for this Kyverno policy validates the policy's functionality and effectiveness. It covers multiple scenarios to ensure proper enforcement and accurate labeling of Kubernetes resources. The test suite employs a combination of configuration files and scripts to assert the desired behavior, guaranteeing the policy's accuracy and preventing unintended modifications.
kubectl kuttl test ./tests/
Should get the following output at the completion of the test case:
- ConfigMap without the lfx-mentorship label in a matching namespace
- ConfigMap with the lfx-mentorship label in a matching namespace
- ConfigMap without the lfx-mentorship label in a non-matching namespace
- Resource other than ConfigMap in a matching namespace
- Resource other than ConfigMap in a non-matching namespace