mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 09:24:23 +00:00
Add test for adding setter with path inside a sequence
This commit is contained in:
@@ -154,6 +154,40 @@ metadata:
|
|||||||
replicas: 3
|
replicas: 3
|
||||||
spec:
|
spec:
|
||||||
replicas: 3 # {"$openapi":"replicas"}
|
replicas: 3 # {"$openapi":"replicas"}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "add-field-inside-sequence",
|
||||||
|
add: Add{
|
||||||
|
FieldValue: "/usr/share/nginx",
|
||||||
|
FieldName: "spec.containers.volumeMounts.mountPath",
|
||||||
|
Ref: "#/definitions/io.k8s.cli.setters.mountPath",
|
||||||
|
},
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
volumeMounts:
|
||||||
|
- name: nginx
|
||||||
|
mountPath: /usr/share/nginx
|
||||||
|
`,
|
||||||
|
expected: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
volumeMounts:
|
||||||
|
- name: nginx
|
||||||
|
mountPath: /usr/share/nginx # {"$openapi":"mountPath"}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user