Skip to content

Commit 0dad432

Browse files
authored
Only return MetaObject from AWSResource.MetaObject() call (#184)
Issue #, if available: aws-controllers-k8s/community#937 Description of changes: * For implementation of AWSResource.MetaObject, we were returning the complete resource. * This change only returns 'ObjectMeta' from AWSResource which is the implementation of 'metav1.Object' inside resource struct * returning only the relevant members helps in metadata comparison correctly with `ackcompare.MetaV1ObjectEqual` --------------- * Unit tests successful * Successful local kind e2e test for newly generated dynamodb controller By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 9cebd89 commit 0dad432

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/pkg/resource/resource.go.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (r *resource) RuntimeObject() k8srt.Object {
4646
// MetaObject returns the Kubernetes apimachinery/apis/meta/v1.Object
4747
// representation of the AWSResource
4848
func (r *resource) MetaObject() metav1.Object {
49-
return r.ko
49+
return r.ko.GetObjectMeta()
5050
}
5151

5252
// RuntimeMetaObject returns an object that implements both the Kubernetes

0 commit comments

Comments
 (0)