Merge pull request #4163 from natasha41575/multipleGvksInOpenApi

support multiple gvks in custom openapi schema
This commit is contained in:
Kubernetes Prow Robot
2021-09-16 12:59:26 -07:00
committed by GitHub
4 changed files with 110 additions and 6 deletions

View File

@@ -296,15 +296,17 @@ func AddDefinitions(definitions spec.Definitions) {
}
// cast the extension to a []map[string]string
exts, ok := gvk.([]interface{})
if !ok || len(exts) != 1 {
continue
}
typeMeta, ok := toTypeMeta(exts[0])
if !ok {
continue
}
globalSchema.schemaByResourceType[typeMeta] = &d
for i := range exts {
typeMeta, ok := toTypeMeta(exts[i])
if !ok {
continue
}
globalSchema.schemaByResourceType[typeMeta] = &d
}
}
}