Skip to content

Commit a4749ba

Browse files
author
Arvind Thirumurugan
committed
convert updateBindingRolloutStarted
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
1 parent 1caebeb commit a4749ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/controllers/updaterun/execution.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,22 +400,22 @@ func (r *Reconciler) checkAfterStageTasksStatus(ctx context.Context, updatingSta
400400
}
401401

402402
// updateBindingRolloutStarted updates the binding status to indicate the rollout has started.
403-
func (r *Reconciler) updateBindingRolloutStarted(ctx context.Context, binding *placementv1beta1.ClusterResourceBinding, updateRun *placementv1beta1.ClusterStagedUpdateRun) error {
403+
func (r *Reconciler) updateBindingRolloutStarted(ctx context.Context, binding placementv1beta1.BindingObj, updateRun placementv1beta1.UpdateRunObj) error {
404404
// first reset the condition to reflect the latest lastTransitionTime
405405
binding.RemoveCondition(string(placementv1beta1.ResourceBindingRolloutStarted))
406406
cond := metav1.Condition{
407407
Type: string(placementv1beta1.ResourceBindingRolloutStarted),
408408
Status: metav1.ConditionTrue,
409-
ObservedGeneration: binding.Generation,
409+
ObservedGeneration: binding.GetGeneration(),
410410
Reason: condition.RolloutStartedReason,
411-
Message: fmt.Sprintf("Detected the new changes on the resources and started the rollout process, resourceSnapshotIndex: %s, clusterStagedUpdateRun: %s", updateRun.Spec.ResourceSnapshotIndex, updateRun.Name),
411+
Message: fmt.Sprintf("Detected the new changes on the resources and started the rollout process, resourceSnapshotIndex: %s, updateRun: %s", updateRun.GetUpdateRunSpec().ResourceSnapshotIndex, updateRun.GetName()),
412412
}
413413
binding.SetConditions(cond)
414414
if err := r.Client.Status().Update(ctx, binding); err != nil {
415-
klog.ErrorS(err, "Failed to update binding status", "clusterResourceBinding", klog.KObj(binding), "condition", cond)
415+
klog.ErrorS(err, "Failed to update binding status", "binding", klog.KObj(binding), "condition", cond)
416416
return controller.NewUpdateIgnoreConflictError(err)
417417
}
418-
klog.V(2).InfoS("Updated binding as rolloutStarted", "clusterResourceBinding", klog.KObj(binding), "condition", cond)
418+
klog.V(2).InfoS("Updated binding as rolloutStarted", "binding", klog.KObj(binding), "condition", cond)
419419
return nil
420420
}
421421

0 commit comments

Comments
 (0)