mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
setters 2.0
This commit is contained in:
@@ -49,6 +49,11 @@ func AddSchema(s []byte) (*spec.Schema, error) {
|
||||
return parse(s)
|
||||
}
|
||||
|
||||
// ResetOpenAPI resets the openapi data to empty
|
||||
func ResetOpenAPI() {
|
||||
globalSchema = openapiData{}
|
||||
}
|
||||
|
||||
// AddDefinitions adds the definitions to the global schema.
|
||||
func AddDefinitions(definitions spec.Definitions) {
|
||||
// initialize values if they have not yet been set
|
||||
@@ -123,7 +128,7 @@ func GetSchema(s string) (*ResourceSchema, error) {
|
||||
// schema as part of the global schema.
|
||||
// Must be called before the schema is used.
|
||||
func SuppressBuiltInSchemaUse() {
|
||||
globalSchema.noUseBuiltInSchema = false
|
||||
globalSchema.noUseBuiltInSchema = true
|
||||
}
|
||||
|
||||
// Elements returns the Schema for the elements of an array.
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestNoUseBuiltInSchema_AddSchema(t *testing.T) {
|
||||
t.FailNow()
|
||||
}
|
||||
s, err := GetSchema(`{"$ref": "#/definitions/io.k8s.config.setters.replicas"}`)
|
||||
if !assert.Greater(t, len(globalSchema.schema.Definitions), 1) {
|
||||
if !assert.Equal(t, len(globalSchema.schema.Definitions), 1) {
|
||||
t.FailNow()
|
||||
}
|
||||
if !assert.NoError(t, err) {
|
||||
|
||||
Reference in New Issue
Block a user