mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
fix issue with openapi schema from components
This commit is contained in:
@@ -418,6 +418,7 @@ openapi:
|
||||
path: openapi.json
|
||||
`)
|
||||
|
||||
openapi.ResetOpenAPI()
|
||||
m := th.Run("overlays/overlay-component-openapi", th.MakeDefaultOptions())
|
||||
th.AssertActualEqualsExpected(m, `apiVersion: apps.openshift.io/v1
|
||||
kind: DeploymentConfig
|
||||
@@ -427,17 +428,23 @@ spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: container
|
||||
- env:
|
||||
- name: foo
|
||||
value: bar
|
||||
name: container
|
||||
volumeMounts:
|
||||
- mountPath: /mnt
|
||||
name: additional-cm
|
||||
- mountPath: /opt/cm
|
||||
name: cm
|
||||
initContainers:
|
||||
- name: init
|
||||
volumes:
|
||||
- configMap:
|
||||
name: additional-cm
|
||||
name: additional-cm
|
||||
- configMap:
|
||||
name: cm
|
||||
name: cm
|
||||
`)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -547,6 +547,9 @@ 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")
|
||||
|
||||
Reference in New Issue
Block a user