Return early from unmarshallOverrides
In keeping with the general principle of minimizing indent.
@@ -42,7 +42,10 @@ func NewClusterOverrides(typeConfig typeconfig.Interface, override *unstructured
func unmarshallOverrides(typeConfig typeconfig.Interface, override *unstructured.Unstructured) (map[string]interface{}, []string, error) {
overrideMap := make(map[string]interface{})
overridePath := []string{}
- if typeConfig.GetOverride() != nil && override != nil {
+ if override == nil || typeConfig.GetOverride() == nil {
+ return overrideMap, overridePath, nil
+ }
+
qualifiedName := NewQualifiedName(override)
overrideKind := typeConfig.GetOverride().Kind
@@ -73,7 +76,6 @@ func unmarshallOverrides(typeConfig typeconfig.Interface, override *unstructured
}
overrideMap[name] = data
}
- }
return overrideMap, overridePath, nil
}
