fix: 'coder update' should always start a workspace (#6437)

* fix: 'coder update' should always start a workspace
This commit is contained in:
Steven Masley
2023-03-06 08:37:11 -06:00
committed by GitHub
parent 260b2b2333
commit 84dd59ecc2
5 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ Workspace Commands:
ssh Start a shell into a workspace
start Start a workspace
stop Stop a workspace
update Update a workspace
update Will update and start a given workspace if it is out of date.
Flags:
--global-config coder Path to the global coder config directory.
+1 -1
View File
@@ -1,4 +1,4 @@
Update a workspace
Will update and start a given workspace if it is out of date. Use --always-prompt to change the parameter values of the workspace.
Usage:
coder update <workspace> [flags]
+4 -2
View File
@@ -20,7 +20,9 @@ func update() *cobra.Command {
Annotations: workspaceCommand,
Use: "update <workspace>",
Args: cobra.ExactArgs(1),
Short: "Update a workspace",
Short: "Will update and start a given workspace if it is out of date.",
Long: "Will update and start a given workspace if it is out of date. Use --always-prompt to change " +
"the parameter values of the workspace.",
RunE: func(cmd *cobra.Command, args []string) error {
client, err := CreateClient(cmd)
if err != nil {
@@ -68,7 +70,7 @@ func update() *cobra.Command {
build, err := client.CreateWorkspaceBuild(cmd.Context(), workspace.ID, codersdk.CreateWorkspaceBuildRequest{
TemplateVersionID: template.ActiveVersionID,
Transition: workspace.LatestBuild.Transition,
Transition: codersdk.WorkspaceTransitionStart,
ParameterValues: buildParams.parameters,
RichParameterValues: buildParams.richParameters,
})
+1 -1
View File
@@ -50,6 +50,6 @@ coder [flags]
| [<code>stop</code>](./cli/coder_stop) | Stop a workspace |
| [<code>templates</code>](./cli/coder_templates) | Manage templates |
| [<code>tokens</code>](./cli/coder_tokens) | Manage personal access tokens |
| [<code>update</code>](./cli/coder_update) | Update a workspace |
| [<code>update</code>](./cli/coder_update) | Will update and start a given workspace if it is out of date. |
| [<code>users</code>](./cli/coder_users) | Manage users |
| [<code>version</code>](./cli/coder_version) | Show coder version |
+1 -1
View File
@@ -2,7 +2,7 @@
# coder update
Update a workspace
Will update and start a given workspace if it is out of date. Use --always-prompt to change the parameter values of the workspace.
## Usage