Start a stopped workspace from the command line
Start a stopped workspace from the command line by setting the spec.started field in the DevWorkspace custom resource to true. .Prerequisites
About this task
- You have an active
ocsession on the cluster. See This page is not included, but the link has been rewritten to point to the nearest parent document.Getting started with the CLI. - You have the workspace name. Run
oc get devworkspacesto list workspace names. - You have the relevant OpenShift Dev Spaces user namespace on the cluster. Visit
https://<openshift_dev_spaces_fqdn>/api/kubernetes/namespaceto get your OpenShift Dev Spaces user namespace asname. - You are in the OpenShift Dev Spaces user namespace on the cluster. On OpenShift, use
octo display your current namespace or switch to a namespace.
Procedure
Run the following command to start a stopped workspace:
$ oc patch devworkspace <workspace_name> \
-p '{"spec":{"started":true}}' \
--type=merge -n <user_namespace> && \
oc wait --for=jsonpath='{.status.phase}'=Running \
dw/<workspace_name> -n <user_namespace>