Skip to content

Commit 5ae9850

Browse files
Add SetStatus for resource (#151)
Description of changes: Generate the new `SetStatus` method, for patching the status of a resource from an another. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent e2a9338 commit 5ae9850

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

templates/pkg/resource/resource.go.tpl

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ func (r *resource) SetObjectMeta(meta metav1.ObjectMeta) {
7171
r.ko.ObjectMeta = meta;
7272
}
7373

74+
// SetStatus will set the Status field for the resource
75+
func (r *resource) SetStatus(desired acktypes.AWSResource) {
76+
r.ko.Status = desired.(*resource).ko.Status
77+
}
78+
7479
// SetIdentifiers sets the Spec or Status field that is referenced as the unique
7580
// resource identifier
7681
func (r *resource) SetIdentifiers(identifier *ackv1alpha1.AWSIdentifiers) error {

0 commit comments

Comments
 (0)