Skip to content

Commit

Permalink
load CRDs as OpenAPI schema for strategic merge support
Browse files Browse the repository at this point in the history
Signed-off-by: Adnan Abdulhussein <[email protected]>
  • Loading branch information
prydonius committed Aug 20, 2020
1 parent 0be4a61 commit 7610688
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/internal/accumulator/loadconfigfromcrds.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/openapi"
"sigs.k8s.io/yaml"
)

Expand All @@ -26,6 +27,9 @@ func LoadConfigFromCRDs(
ldr ifc.Loader, paths []string) (*builtinconfig.TransformerConfig, error) {
tc := builtinconfig.MakeEmptyConfig()
for _, path := range paths {
if err := openapi.AddSchemaFromFileUsingField(ldr.Root()+"/"+path, ""); err != nil {
panic(err)
}
content, err := ldr.Load(path)
if err != nil {
return nil, err
Expand Down

0 comments on commit 7610688

Please sign in to comment.