Skip to content

Commit

Permalink
Add "InProgress" condition both on Plan creation and upgrade validati…
Browse files Browse the repository at this point in the history
…on steps (#21)

* Add conditions both on plan creation and update validation

* Fix log
  • Loading branch information
ipetrov117 authored Jul 26, 2024
1 parent 88fbcd2 commit cfe7477
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/controller/reconcile_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func (r *UpgradePlanReconciler) reconcileKubernetes(ctx context.Context, upgrade
return ctrl.Result{}, err
}

setInProgressCondition(upgradePlan, lifecyclev1alpha1.KubernetesUpgradedCondition, "Control plane nodes are being upgraded")
return ctrl.Result{}, r.createPlan(ctx, upgradePlan, controlPlanePlan)
}

Expand All @@ -55,6 +56,7 @@ func (r *UpgradePlanReconciler) reconcileKubernetes(ctx context.Context, upgrade
return ctrl.Result{}, err
}

setInProgressCondition(upgradePlan, lifecyclev1alpha1.KubernetesUpgradedCondition, "Worker nodes are being upgraded")
return ctrl.Result{}, r.createPlan(ctx, upgradePlan, workerPlan)
}

Expand Down
1 change: 1 addition & 0 deletions internal/controller/reconcile_os.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (r *UpgradePlanReconciler) reconcileOS(ctx context.Context, upgradePlan *li
}

if !isOSUpgraded(nodeList, selector, release.Components.OperatingSystem.PrettyName) {
setInProgressCondition(upgradePlan, lifecyclev1alpha1.OperatingSystemUpgradedCondition, "Control plane nodes are being upgraded")
return ctrl.Result{}, nil
} else if controlPlaneOnlyCluster(nodeList) {
setSuccessfulCondition(upgradePlan, lifecyclev1alpha1.OperatingSystemUpgradedCondition, "All cluster nodes are upgraded")
Expand Down

0 comments on commit cfe7477

Please sign in to comment.