Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions templates/pkg/resource/descriptor.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const (
)

var (
resourceGK = metav1.GroupKind{
GroupVersionResource = svcapitypes.GroupVersion.WithResource("{{ ToLower .CRD.Plural }}")
GroupKind = metav1.GroupKind{
Group: "{{ .APIGroup }}",
Kind: "{{ .CRD.Kind }}",
}
Expand All @@ -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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this method?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because the runtime doesn't import the resource package itself (it loads the resource manager factory from a registry) but still needs to know the GroupKind:

https://github.com/aws-controllers-k8s/runtime/blob/8e4dc5ecc41f9370e413c3be4ee88baf67ecbcd1/pkg/runtime/reconciler.go#L65-L72

return &resourceGK
return &GroupKind
}

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