Use k8s schema to determine formatting if no type on setter

This commit is contained in:
Morten Torkildsen
2020-07-31 13:44:47 -07:00
parent feeaa994b7
commit 5c433ead5e
5 changed files with 26 additions and 15 deletions

View File

@@ -126,7 +126,7 @@ metadata:
},
{
name: "set-foo-no-type",
description: "if a type is not specified for a setter, keep the existing quoting",
description: "if a type is not specified for a setter or k8s schema, keep existing quoting",
setter: "foo",
openapi: `
openAPI:
@@ -138,16 +138,16 @@ openAPI:
value: "4"
`,
input: `
apiVersion: apps/v1
kind: Deployment
apiVersion: custom/v1
kind: Example
metadata:
name: nginx-deployment
annotations:
foo: 3 # {"$ref": "#/definitions/io.k8s.cli.setters.foo"}
`,
expected: `
apiVersion: apps/v1
kind: Deployment
apiVersion: custom/v1
kind: Example
metadata:
name: nginx-deployment
annotations: