Throw insufficient arguments error for create-setter

This commit is contained in:
Phani Teja Marupaka
2020-08-04 00:41:52 -07:00
parent c9e8631399
commit fc83477ec8
2 changed files with 36 additions and 2 deletions

View File

@@ -166,6 +166,36 @@ spec:
`,
},
{
name: "add replicas not enough arguments",
args: []string{"replicas", "--description", "hello world", "--set-by", "me"},
err: `setter name and value must be provided, value can either be an argument or can be passed as a flag --value`,
input: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
`,
inputOpenAPI: `
apiVersion: v1alpha1
kind: Example
`,
expectedOpenAPI: `
apiVersion: v1alpha1
kind: Example
`,
expectedResources: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
`,
},
{
name: "list values with schema",
args: []string{"list", "--description", "hello world", "--set-by", "me", "--type", "array", "--field", "spec.list"},