Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

How to remove workflow use drpcli? #517

Closed
j0ck1e opened this issue May 12, 2021 · 1 comment
Closed

How to remove workflow use drpcli? #517

j0ck1e opened this issue May 12, 2021 · 1 comment

Comments

@j0ck1e
Copy link

j0ck1e commented May 12, 2021

drpcli machines stage 1650e1e1-a7ad-46ab-9635-53565de7ddd3 complete

Error: ValidationError: machines/1650e1e1-a7ad-46ab-9635-53565de7ddd3
1650e1e1-a7ad-46ab-9635-53565de7ddd3: Changing machine bootenv not allowed; remove workflow first
1650e1e1-a7ad-46ab-9635-53565de7ddd3: Changing machine stage not allowed; remove workflow first

@sygibson
Copy link
Contributor

@j0ck1e

You are trying to change the Stage of a machine. If the Machine has a Workflow set, then the Workflow controls the Stage transitions, based on what the Workflow stage list specifies.

You can not independently change a Stage on a Machine in that case. It's a safety mechanism to prevent you from "screwing up" the Stage transitions when a machine is under control of a Workflow.

If you DO want to change Stages and only execute a Stage instead of all of the Stages specified in a Workflow; you must remove the Workflow from the machine first, then you can set the Stage. This procedure also shows you how to correctly remove the Workflow with the CLI.

drpcli machines workflow Name:mach-01 ""

Note the empty double quotes to set Workflow to empty. Now you can use jq to show/parse the results:

drpcli machines show Name:mach-01 | jq -r '"workflow: \(.Workflow) \nstage: \(.Stage)"'

This should print an empty result for Workflow, and "none" for Stage.

Now you can transition a machine to just Stage changes manually with:

drpcli machines stage Name:mach-01 hello-world

(hello-world is a Stage in the dev-library content pack).

The error message tells you that the operation of changing Stage is not allowed - and that you must "remove workflow first".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants