Skip to content

Commit c974740

Browse files
amisevskibuziuk
authored andcommitted
Log reason for stopping a workspace if stopped-by annotation is present
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
1 parent 67664b9 commit c974740

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

controllers/workspace/devworkspace_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ func (r *DevWorkspaceReconciler) stopWorkspace(ctx context.Context, workspace *d
482482
status.setConditionFalse(conditions.Started, "Workspace is stopped")
483483
}
484484
}
485+
if stoppedBy, ok := workspace.Annotations[constants.DevWorkspaceStopReasonAnnotation]; ok {
486+
logger.Info("Workspace stopped with reason", "stopped-by", stoppedBy)
487+
}
485488
return r.updateWorkspaceStatus(workspace, logger, &status, reconcile.Result{}, nil)
486489
}
487490

0 commit comments

Comments
 (0)