From 5e83d3f197d841e15d4bdf75adb3a2052c802965 Mon Sep 17 00:00:00 2001 From: Rita Zhang Date: Fri, 28 Apr 2023 05:49:02 -0700 Subject: [PATCH] docs: add assignImage mutation demo (#2694) Signed-off-by: Rita Zhang --- demo/mutation/assignimagedemo.yaml | 18 ++++++++++++++++++ demo/mutation/pod.yaml | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 demo/mutation/assignimagedemo.yaml create mode 100644 demo/mutation/pod.yaml diff --git a/demo/mutation/assignimagedemo.yaml b/demo/mutation/assignimagedemo.yaml new file mode 100644 index 00000000000..2f6e3c8162d --- /dev/null +++ b/demo/mutation/assignimagedemo.yaml @@ -0,0 +1,18 @@ +apiVersion: mutations.gatekeeper.sh/v1alpha1 +kind: AssignImage +metadata: + name: assign-container-image-registry +spec: + applyTo: + - groups: [ "" ] + kinds: [ "Pod" ] + versions: [ "v1" ] + location: "spec.containers[name:*].image" + parameters: + assignDomain: "mycompany.registry.io" + match: + source: "All" + scope: Namespaced + kinds: + - apiGroups: [ "*" ] + kinds: [ "Pod" ] diff --git a/demo/mutation/pod.yaml b/demo/mutation/pod.yaml new file mode 100644 index 00000000000..5dc4087838b --- /dev/null +++ b/demo/mutation/pod.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Pod +metadata: + name: nginx +spec: + containers: + - name: nginx + image: nginx + imagePullPolicy: IfNotPresent