Merge pull request #2707 from mortent/FixDotInSetterName

Allow setters/substitutions with . in the name
This commit is contained in:
Kubernetes Prow Robot
2020-07-13 10:03:20 -07:00
committed by GitHub
4 changed files with 71 additions and 3 deletions

View File

@@ -372,6 +372,41 @@ metadata:
name: nginx-deployment
spec:
replicas: 3 # {"$openapi":"replicas"}
`,
},
{
name: "add setter with . in the name",
args: []string{"foo.bar", "3"},
input: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
`,
inputOpenAPI: `
apiVersion: v1alpha1
kind: Example
`,
expectedOpenAPI: `
apiVersion: v1alpha1
kind: Example
openAPI:
definitions:
io.k8s.cli.setters.foo.bar:
x-k8s-cli:
setter:
name: foo.bar
value: "3"
`,
expectedResources: `
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3 # {"$openapi":"foo.bar"}
`,
},
}