Skip to content

Remote Dev: Prevent update of terminated workspaces

Chad Woolley requested to merge caw-rd-termination-is-permanent into master

Issue: Add validation preventing desired_state change ... (#409773 - closed)

What does this MR do and why?

Implements Add validation preventing desired_state change ... (#409773 - closed)

Remote Dev: Prevent update of terminated workspaces

  • desired_state cannot be updated for terminated workspaces

Screenshots or screen recordings

Result of GraphQL mutation, showing error message:

mutation workspaceUpdate($workspaceId: RemoteDevelopmentWorkspaceID!) {
  workspaceUpdate(
    input: {id: $workspaceId, desiredState: "Running"}
  ) {
    clientMutationId
    workspace {
      id
      name
      url
      desiredState
      actualState
      editor
      maxHoursBeforeTermination
      devfile
      deploymentResourceVersion
    }
    errors
  }
}
{
  "data": {
    "workspaceUpdate": {
      "clientMutationId": null,
      "workspace": null,
      "errors": [
        "Workspace update failed: Desired state is 'Terminated', and cannot be updated. Create a new workspace instead."
      ]
    }
  }
}

How to set up and validate locally

Run mutation as shown above in GraphiQL for a terminated workspace.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading