Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 84dd59e

Browse files
authored
fix: 'coder update' should always start a workspace (#6437)
* fix: 'coder update' should always start a workspace
1 parent 260b2b2 commit 84dd59e

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

cli/testdata/coder_--help.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Workspace Commands:
4545
ssh Start a shell into a workspace
4646
start Start a workspace
4747
stop Stop a workspace
48-
update Update a workspace
48+
update Will update and start a given workspace if it is out of date.
4949

5050
Flags:
5151
--global-config coder Path to the global coder config directory.

cli/testdata/coder_update_--help.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Update a workspace
1+
Will update and start a given workspace if it is out of date. Use --always-prompt to change the parameter values of the workspace.
22

33
Usage:
44
coder update <workspace> [flags]

cli/update.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ func update() *cobra.Command {
2020
Annotations: workspaceCommand,
2121
Use: "update <workspace>",
2222
Args: cobra.ExactArgs(1),
23-
Short: "Update a workspace",
23+
Short: "Will update and start a given workspace if it is out of date.",
24+
Long: "Will update and start a given workspace if it is out of date. Use --always-prompt to change " +
25+
"the parameter values of the workspace.",
2426
RunE: func(cmd *cobra.Command, args []string) error {
2527
client, err := CreateClient(cmd)
2628
if err != nil {
@@ -68,7 +70,7 @@ func update() *cobra.Command {
6870

6971
build, err := client.CreateWorkspaceBuild(cmd.Context(), workspace.ID, codersdk.CreateWorkspaceBuildRequest{
7072
TemplateVersionID: template.ActiveVersionID,
71-
Transition: workspace.LatestBuild.Transition,
73+
Transition: codersdk.WorkspaceTransitionStart,
7274
ParameterValues: buildParams.parameters,
7375
RichParameterValues: buildParams.richParameters,
7476
})

docs/cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ coder [flags]
5050
| [<code>stop</code>](./cli/coder_stop) | Stop a workspace |
5151
| [<code>templates</code>](./cli/coder_templates) | Manage templates |
5252
| [<code>tokens</code>](./cli/coder_tokens) | Manage personal access tokens |
53-
| [<code>update</code>](./cli/coder_update) | Update a workspace |
53+
| [<code>update</code>](./cli/coder_update) | Will update and start a given workspace if it is out of date. |
5454
| [<code>users</code>](./cli/coder_users) | Manage users |
5555
| [<code>version</code>](./cli/coder_version) | Show coder version |

docs/cli/coder_update.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# coder update
44

5-
Update a workspace
5+
Will update and start a given workspace if it is out of date. Use --always-prompt to change the parameter values of the workspace.
66

77
## Usage
88

0 commit comments

Comments
 (0)