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 oc session on the cluster. See Getting started with the CLI.
  • You have the workspace name. Run oc get devworkspaces to list workspace names.
  • You have the relevant OpenShift Dev Spaces user namespace on the cluster. Visit https://<openshift_dev_spaces_fqdn>/api/kubernetes/namespace to get your OpenShift Dev Spaces user namespace as name.
  • You are in the OpenShift Dev Spaces user namespace on the cluster. On OpenShift, use oc to 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>