Add test for adding setter with path inside a sequence

This commit is contained in:
Morten Torkildsen
2020-08-12 20:04:39 -07:00
parent b47e34ea5e
commit bcdbb1a282

View File

@@ -154,6 +154,40 @@ metadata:
replicas: 3
spec:
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"}
`,
},
{