Skip to content

Commit b6b4012

Browse files
Export GroupVersionResource and GroupKind variables (#212)
Fixes aws-controllers-k8s/community#998 Description of changes: `GroupVersionResource` is used by dynamic clients to specify the CRD to be CRUD'd. `GroupKind` is sometimes used in place where the version is not necessarily specified. I chose to export this mainly because it could be used down the line by other dynamic clients. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 15c7f5c commit b6b4012

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

templates/pkg/resource/descriptor.go.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const (
1818
)
1919

2020
var (
21-
resourceGK = metav1.GroupKind{
21+
GroupVersionResource = svcapitypes.GroupVersion.WithResource("{{ ToLower .CRD.Plural }}")
22+
GroupKind = metav1.GroupKind{
2223
Group: "{{ .APIGroup }}",
2324
Kind: "{{ .CRD.Kind }}",
2425
}
@@ -32,7 +33,7 @@ type resourceDescriptor struct {
3233
// GroupKind returns a Kubernetes metav1.GroupKind struct that describes the
3334
// API Group and Kind of CRs described by the descriptor
3435
func (d *resourceDescriptor) GroupKind() *metav1.GroupKind {
35-
return &resourceGK
36+
return &GroupKind
3637
}
3738

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

0 commit comments

Comments
 (0)