Error on creation if setter/subst exists

This commit is contained in:
Phani Teja Marupaka
2020-08-06 06:45:26 -07:00
parent 6afabf26ae
commit 83a70f7830
4 changed files with 66 additions and 121 deletions

View File

@@ -125,6 +125,24 @@ openAPI:
err: "substitution with name my-image already exists, substitution and setter can't have same name",
},
{
name: "error if setter with same name exists",
args: []string{
"my-image", "ubuntu"},
inputOpenAPI: `
apiVersion: v1alpha1
kind: Example
openAPI:
definitions:
io.k8s.cli.setters.my-image:
x-k8s-cli:
setter:
name: my-image
value: "nginx"
`,
err: "setter with name my-image already exists, if you want to modify it, please delete the existing setter and recreate it",
},
{
name: "add replicas with schema",
args: []string{"replicas", "3", "--description", "hello world", "--set-by", "me"},