Remove delegation to RNode in Resource.

This commit is contained in:
monopole
2021-05-07 15:44:52 -07:00
parent 1e3ce57077
commit 5c4e363f11
14 changed files with 188 additions and 288 deletions

View File

@@ -168,11 +168,6 @@ func selectSourceNode(nodes []*yaml.RNode, selector *types.SourceSelector) (*yam
// makeResId makes a ResId from an RNode.
func makeResId(n *yaml.RNode) *resid.ResId {
ns, err := n.GetNamespace()
if err != nil {
// Resource has no metadata (no apiVersion, kind, nor metadata field).
return nil
}
apiVersion := n.Field(yaml.APIVersionField)
var group, version string
if apiVersion != nil {
@@ -181,6 +176,6 @@ func makeResId(n *yaml.RNode) *resid.ResId {
return &resid.ResId{
Gvk: resid.Gvk{Group: group, Version: version, Kind: n.GetKind()},
Name: n.GetName(),
Namespace: ns,
Namespace: n.GetNamespace(),
}
}