Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
mjudeikis committed Nov 24, 2024
1 parent 5bc6985 commit 9f10e30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/reconciler/tenancy/workspace/workspace_reconcile_phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r *phaseReconciler) reconcile(ctx context.Context, workspace *tenancyv1alp
conditions.MarkTrue(workspace, tenancyv1alpha1.WorkspaceInitialized)

case corev1alpha1.LogicalClusterPhaseUnavailable:
if updateTerminalConditionPhase(workspace) {
if terminalConditionPhase(workspace) {
return reconcileStatusStopAndRequeue, nil
}
return reconcileStatusContinue, nil
Expand Down Expand Up @@ -118,7 +118,7 @@ func (r *phaseReconciler) reconcile(ctx context.Context, workspace *tenancyv1alp
}

// if workspace is ready, we check if it suppose to be ready by checking conditions.
if updateTerminalConditionPhase(workspace) {
if terminalConditionPhase(workspace) {
logger.Info("workspace phase changed", "status", workspace.Status)
return reconcileStatusStopAndRequeue, nil
}
Expand All @@ -127,9 +127,9 @@ func (r *phaseReconciler) reconcile(ctx context.Context, workspace *tenancyv1alp
return reconcileStatusContinue, nil
}

// updateTerminalConditionPhase checks if the workspace is ready by checking conditions and sets the phase accordingly.
// terminalConditionPhase checks if the workspace is ready by checking conditions and sets the phase accordingly.
// It returns true if the phase was changed, false otherwise.
func updateTerminalConditionPhase(workspace *tenancyv1alpha1.Workspace) bool {
func terminalConditionPhase(workspace *tenancyv1alpha1.Workspace) bool {
var notReady bool
for _, c := range workspace.Status.Conditions {
if c.Status == v1.ConditionFalse && strings.HasPrefix(string(c.Type), "Workspace") {
Expand Down

0 comments on commit 9f10e30

Please sign in to comment.