Skip to content

Commit 657c1c9

Browse files
Revert "Patch metadata and spec when handling errors (#92)" (#96)
This reverts commit de27382. Description of changes: Adding a patch in `HandleReconcileError` caused subsequent test failures in the EKS controller, and ultimately did not fix the issue in the RDS controller. This PR is to revert that change so that we can roll back to a known good state for any other controllers that may have been affected. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 35dd8c1 commit 657c1c9

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

pkg/runtime/reconciler.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,6 @@ func (r *resourceReconciler) HandleReconcileError(
860860
err error,
861861
) (ctrlrt.Result, error) {
862862
if ackcompare.IsNotNil(latest) {
863-
// Create a copy so we don't override the spec
864-
latestCopy := latest.DeepCopy()
865863
// The reconciliation loop may have returned an error, but if latest is
866864
// not nil, there may be some changes available in the CR's Status
867865
// struct (example: Conditions), and we want to make sure we save those
@@ -875,18 +873,13 @@ func (r *resourceReconciler) HandleReconcileError(
875873
//
876874
// TODO(jaypipes): We ignore error handling here but I don't know if
877875
// there is a more robust way to handle failures in the patch operation
878-
_ = r.patchResourceStatus(ctx, desired, latestCopy)
876+
_ = r.patchResourceStatus(ctx, desired, latest)
879877
}
880878
if err == nil || err == ackerr.Terminal {
881879
return ctrlrt.Result{}, nil
882880
}
883881
rlog := ackrtlog.FromContext(ctx)
884882

885-
// Ensure that we are patching any changes to the annotations/metadata and
886-
// the Spec that may have been set by the resource manager's successful
887-
// Create call above.
888-
_ = r.patchResourceMetadataAndSpec(ctx, desired, latest)
889-
890883
var requeueNeededAfter *requeue.RequeueNeededAfter
891884
if errors.As(err, &requeueNeededAfter) {
892885
after := requeueNeededAfter.Duration()

0 commit comments

Comments
 (0)