mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
separate custom openapi test from the others
This commit is contained in:
@@ -547,9 +547,6 @@ func SetSchema(openAPIField map[string]string, schema []byte, reset bool) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// if the schema is changed, initSchema should parse the new schema
|
||||
defer func() { globalSchema.schemaInit = false }()
|
||||
|
||||
version, exists := openAPIField["version"]
|
||||
if exists && schema != nil {
|
||||
return fmt.Errorf("builtin version and custom schema provided, cannot use both")
|
||||
@@ -558,6 +555,8 @@ func SetSchema(openAPIField map[string]string, schema []byte, reset bool) error
|
||||
if schema != nil { // use custom schema
|
||||
customSchema = schema
|
||||
kubernetesOpenAPIVersion = "custom"
|
||||
// if the schema is changed, initSchema should parse the new schema
|
||||
globalSchema.schemaInit = false
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -570,6 +569,8 @@ func SetSchema(openAPIField map[string]string, schema []byte, reset bool) error
|
||||
return fmt.Errorf("the specified OpenAPI version is not built in")
|
||||
}
|
||||
customSchema = nil
|
||||
// if the schema is changed, initSchema should parse the new schema
|
||||
globalSchema.schemaInit = false
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user