Skip to content

Commit 5e83d3f

Browse files
authored
docs: add assignImage mutation demo (#2694)
Signed-off-by: Rita Zhang <[email protected]>
1 parent cf2e7d5 commit 5e83d3f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

demo/mutation/assignimagedemo.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: mutations.gatekeeper.sh/v1alpha1
2+
kind: AssignImage
3+
metadata:
4+
name: assign-container-image-registry
5+
spec:
6+
applyTo:
7+
- groups: [ "" ]
8+
kinds: [ "Pod" ]
9+
versions: [ "v1" ]
10+
location: "spec.containers[name:*].image"
11+
parameters:
12+
assignDomain: "mycompany.registry.io"
13+
match:
14+
source: "All"
15+
scope: Namespaced
16+
kinds:
17+
- apiGroups: [ "*" ]
18+
kinds: [ "Pod" ]

demo/mutation/pod.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: nginx
5+
spec:
6+
containers:
7+
- name: nginx
8+
image: nginx
9+
imagePullPolicy: IfNotPresent

0 commit comments

Comments
 (0)