From e69710bc7cba3d6f8fbe71f1b5283c1264aa7834 Mon Sep 17 00:00:00 2001 From: Nicholas Thomson Date: Thu, 30 Sep 2021 14:30:09 -0700 Subject: [PATCH] Export GVR and GK variables --- templates/pkg/resource/descriptor.go.tpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/pkg/resource/descriptor.go.tpl b/templates/pkg/resource/descriptor.go.tpl index 42ac27b6..08eb5b78 100644 --- a/templates/pkg/resource/descriptor.go.tpl +++ b/templates/pkg/resource/descriptor.go.tpl @@ -18,7 +18,8 @@ const ( ) var ( - resourceGK = metav1.GroupKind{ + GroupVersionResource = svcapitypes.GroupVersion.WithResource("{{ ToLower .CRD.Plural }}") + GroupKind = metav1.GroupKind{ Group: "{{ .APIGroup }}", Kind: "{{ .CRD.Kind }}", } @@ -32,7 +33,7 @@ type resourceDescriptor struct { // GroupKind returns a Kubernetes metav1.GroupKind struct that describes the // API Group and Kind of CRs described by the descriptor func (d *resourceDescriptor) GroupKind() *metav1.GroupKind { - return &resourceGK + return &GroupKind } // EmptyRuntimeObject returns an empty object prototype that may be used in