From 2619d7ba851d3974d964cc3420ed8c90fce7803a Mon Sep 17 00:00:00 2001 From: Jim Bugwadia Date: Thu, 23 May 2019 00:37:20 -0700 Subject: [PATCH] - make dir case consistent - move files --- documentation/testing-policies.md | 2 +- examples/CLI/{deployment => }/policy-deployment.yaml | 9 ++++++++- examples/CLI/{deployment => }/resources/ghost.yaml | 0 examples/CLI/{deployment => }/resources/nginx.yaml | 0 4 files changed, 9 insertions(+), 2 deletions(-) rename examples/CLI/{deployment => }/policy-deployment.yaml (81%) rename examples/CLI/{deployment => }/resources/ghost.yaml (100%) rename examples/CLI/{deployment => }/resources/nginx.yaml (100%) diff --git a/documentation/testing-policies.md b/documentation/testing-policies.md index a308bcaad8..40767d7b1c 100644 --- a/documentation/testing-policies.md +++ b/documentation/testing-policies.md @@ -56,7 +56,7 @@ To test a policy using the CLI type: For example: ```bash -kyverno ../../examples/CLI/policy-deployment.yaml ../../examples/CLI/resources +kyverno ../../examples/cli/policy-deployment.yaml ../../examples/cli/resources ``` In future releases, the CLI will support complete validation of policies and will allow testing policies against resources in Kubernetes clusters. diff --git a/examples/CLI/deployment/policy-deployment.yaml b/examples/CLI/policy-deployment.yaml similarity index 81% rename from examples/CLI/deployment/policy-deployment.yaml rename to examples/CLI/policy-deployment.yaml index dce1867419..f307427428 100644 --- a/examples/CLI/deployment/policy-deployment.yaml +++ b/examples/CLI/policy-deployment.yaml @@ -4,7 +4,7 @@ metadata : name : policy-deployment spec : rules: - - name: deployment-policy + - name: add-label resource: kinds : - Deployment @@ -19,6 +19,13 @@ spec : - path: /metadata/labels/app op: replace value: "nginx_is_mutated" + - name: check-image + resource: + kinds : + - Deployment + selector : + matchLabels : + cli: test validate: message: "The imagePullPolicy must be Always when :latest is used as a tag" pattern: diff --git a/examples/CLI/deployment/resources/ghost.yaml b/examples/CLI/resources/ghost.yaml similarity index 100% rename from examples/CLI/deployment/resources/ghost.yaml rename to examples/CLI/resources/ghost.yaml diff --git a/examples/CLI/deployment/resources/nginx.yaml b/examples/CLI/resources/nginx.yaml similarity index 100% rename from examples/CLI/deployment/resources/nginx.yaml rename to examples/CLI/resources/nginx.yaml