Skip to content

Commit f60788f

Browse files
Replace GroupKind with GroupVersionKind in ResourceDescriptor (#431)
* Add GVK to ResourceDescriptor * Remove GroupKind
1 parent 2c79531 commit f60788f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

templates/pkg/resource/descriptor.go.tpl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package {{ .CRD.Names.Snake }}
44

55
import (
6+
"k8s.io/apimachinery/pkg/runtime/schema"
67
ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
78
acktypes "github.com/aws-controllers-k8s/runtime/pkg/types"
89
ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
@@ -30,10 +31,10 @@ var (
3031
type resourceDescriptor struct {
3132
}
3233

33-
// GroupKind returns a Kubernetes metav1.GroupKind struct that describes the
34-
// API Group and Kind of CRs described by the descriptor
35-
func (d *resourceDescriptor) GroupKind() *metav1.GroupKind {
36-
return &GroupKind
34+
// GroupVersionKind returns a Kubernetes schema.GroupVersionKind struct that
35+
// describes the API Group, Version and Kind of CRs described by the descriptor
36+
func (d *resourceDescriptor) GroupVersionKind() schema.GroupVersionKind {
37+
return svcapitypes.GroupVersion.WithKind(GroupKind.Kind)
3738
}
3839

3940
// EmptyRuntimeObject returns an empty object prototype that may be used in

0 commit comments

Comments
 (0)