Skip to content

Commit 7c48207

Browse files
authored
fix: ensure Status fields are populated! (#181)
Issue [#2459](aws-controllers-k8s/community#2459) Description of changes: When we have adopt-or-create, the populated status was not getting patched to k8s. So, during the next reconcile, the controller attempts to recreate the resource. With this fix, we ensure that the controller does patch the resource with the adoption field! By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 231b87e commit 7c48207

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/runtime/reconciler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ func (r *resourceReconciler) Sync(
446446
}
447447
if adoptionPolicy == AdoptionPolicy_AdoptOrCreate {
448448
// here we assume the spec fields are provided in the spec.
449+
resolved = resolved.DeepCopy()
449450
resolved.SetStatus(populated)
450451
} else {
451452
resolved = populated

0 commit comments

Comments
 (0)