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:
@@ -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] {
|
||||
|
Reference in New Issue
Block a user