Determine namespaceability of resources from openapi schema

This commit is contained in:
Morten Torkildsen
2020-09-12 14:37:56 -07:00
parent 5c8c7a043a
commit d083c7f1d0
7 changed files with 68115 additions and 4825 deletions

View File

@@ -38,7 +38,7 @@ metadata:
spec:
replicas: 3 # {"$ref": "#/definitions/io.k8s.cli.setters.replicas"}
`
_, err := openapi.AddSchema([]byte(schema)) // add the schema definitions
err := openapi.AddSchema([]byte(schema)) // add the schema definitions
if err != nil {
panic(err)
}
@@ -103,7 +103,7 @@ spec:
image: nginx:1.7.9 # {"$ref": "#/definitions/io.k8s.cli.substitutions.image"}
`
_, err := openapi.AddSchema([]byte(schema)) // add the schema definitions
err := openapi.AddSchema([]byte(schema)) // add the schema definitions
if err != nil {
panic(err)
}

View File

@@ -954,7 +954,7 @@ func initSchema(t *testing.T, s string) {
openapi.ResetOpenAPI()
// add the json schema to the global schema
_, err = openapi.AddSchema(j)
err = openapi.AddSchema(j)
if !assert.NoError(t, err) {
t.FailNow()
}