Simplify gvk, speed up cluster-scoped checks.

This commit is contained in:
monopole
2021-05-02 10:23:07 -07:00
parent 48d16f877b
commit 660847225d
20 changed files with 167 additions and 335 deletions

View File

@@ -87,12 +87,7 @@ func (r *Resource) GetBinaryDataMap() map[string]string {
}
func (r *Resource) GetGvk() resid.Gvk {
meta, err := r.node.GetMeta()
if err != nil {
return resid.GvkFromString("")
}
g, v := resid.ParseGroupVersion(meta.APIVersion)
return resid.Gvk{Group: g, Version: v, Kind: meta.Kind}
return resid.GvkFromNode(r.node)
}
func (r *Resource) Hash(h ifc.KustHasher) (string, error) {