convert PrevIds to use apiVersion instead meta

Since PrevIds uses only the apiVersion information from the metadata,
change the retrieval from the full meta to just the apiVersion.
This commit is contained in:
Ed Overton
2022-09-27 14:03:59 -04:00
parent 65aeefd281
commit d37fabf876

View File

@@ -49,11 +49,8 @@ func PrevIds(n *yaml.RNode) ([]resid.ResId, error) {
"number of previous namespaces, " +
"number of previous kinds not equal")
}
meta, err := n.GetMeta()
if err != nil {
return nil, fmt.Errorf("cannot parse resource metadata: %w", err)
}
group, version := resid.ParseGroupVersion(meta.APIVersion)
apiVersion := n.GetApiVersion()
group, version := resid.ParseGroupVersion(apiVersion)
for i := range names {
gvk := resid.Gvk{
Group: group,