From 0b8a04ae18be60886010a0495e9eacff60dbbd1d Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Fri, 27 Aug 2021 18:59:28 +0200 Subject: [PATCH] util/GetGVKMetadata: fix get PartialObjectMetadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- util/util.go | 1 + 1 file changed, 1 insertion(+) diff --git a/util/util.go b/util/util.go index 201ccc5a3d3b..9fa0818617b7 100644 --- a/util/util.go +++ b/util/util.go @@ -422,6 +422,7 @@ func HasOwner(refList []metav1.OwnerReference, apiVersion string, kinds []string func GetGVKMetadata(ctx context.Context, c client.Client, gvk schema.GroupVersionKind) (*metav1.PartialObjectMetadata, error) { meta := &metav1.PartialObjectMetadata{} meta.SetName(fmt.Sprintf("%s.%s", flect.Pluralize(strings.ToLower(gvk.Kind)), gvk.Group)) + meta.SetGroupVersionKind(apiextensionsv1.SchemeGroupVersion.WithKind("CustomResourceDefinition")) if err := c.Get(ctx, client.ObjectKeyFromObject(meta), meta); err != nil { return meta, errors.Wrap(err, "failed to retrieve metadata from GVK resource") }