Reduce unstruct notation noise in Resource construction.

This commit is contained in:
jregan
2018-06-09 08:04:03 -07:00
parent 2b05d39067
commit ccd255f323
13 changed files with 908 additions and 1146 deletions

View File

@@ -101,7 +101,7 @@ func (m ResMap) insert(newName string, obj *unstructured.Unstructured) error {
return fmt.Errorf("The <name: %q, GroupVersionKind: %v> already exists in the map", oldName, gvk)
}
obj.SetName(newName)
m[id] = resource.NewBehaviorlessResource(obj)
m[id] = resource.NewResourceFromUnstruct(*obj)
return nil
}
@@ -183,7 +183,7 @@ func newResourceSliceFromBytes(in []byte) ([]*resource.Resource, error) {
if err != nil {
break
}
result = append(result, resource.NewBehaviorlessResource(&out))
result = append(result, resource.NewResourceFromUnstruct(out))
}
if err != io.EOF {
return nil, err