1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-18 08:14:56 +00:00

Fix schema pruning

This commit is contained in:
Darren Shepherd
2017-12-16 01:25:37 -07:00
parent 627e06e37f
commit 60e03d42c9

View File

@@ -72,15 +72,11 @@ func addSchema(schema *types.Schema, schemaMap map[string]*types.Schema, schemas
func traverseAndAdd(schema *types.Schema, schemaMap map[string]*types.Schema, schemas []*types.Schema, included map[string]bool) []*types.Schema {
for _, field := range schema.ResourceFields {
t := field.Type
if definition.HasReferenceType(t) {
for !definition.IsReferenceType(t) {
newT := definition.SubType(t)
if newT == t {
break
}
t = newT
}
t := ""
subType := field.Type
for subType != t {
t = subType
subType = definition.SubType(t)
}
if refSchema, ok := schemaMap[t]; ok && !included[t] {