Skip to content

Commit 2f99bcd

Browse files
Update pkg/reconciler/managed/reconciler.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent d8085af commit 2f99bcd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/reconciler/managed/reconciler.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,17 +1471,16 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (resu
14711471
if !policy.ShouldUpdate() {
14721472
reconcileAfter := r.pollIntervalHook(managed, r.pollInterval)
14731473
log.Debug("Skipping update due to managementPolicies. Reconciliation succeeded", "requeue-after", time.Now().Add(reconcileAfter))
1474-
14751474
// since there is a diff between spec and upstream, we want to inform the user
14761475
// about the diff, but that we will not update it - indicating that we WOULD perform
14771476
// changes if we could. This is helpful in migration scenarios to crossplane where
14781477
// the diff between actual and desired must be analyzed for potential impacts first,
14791478
// before giving Crossplane control over the resource.
1480-
status.MarkConditions(
1481-
xpv1.ReconcileForbidden().
1482-
WithMessage(fmt.Sprintf(
1483-
"External resource differs from desired state, but will not update: %s",
1484-
observation.Diff)))
1479+
msg := "External resource differs from desired state, but will not update due to managementPolicy."
1480+
if observation.Diff != "" {
1481+
msg = fmt.Sprintf("%s Diff: %s", msg, observation.Diff)
1482+
}
1483+
status.MarkConditions(xpv1.ReconcileForbidden().WithMessage(msg))
14851484

14861485
return reconcile.Result{RequeueAfter: reconcileAfter}, errors.Wrap(r.client.Status().Update(ctx, managed), errUpdateManagedStatus)
14871486
}

0 commit comments

Comments
 (0)