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

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/testdata/coder_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cli/testdata/coder_update_--help.golden
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 4 additions & 2 deletions cli/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
})
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
2 changes: 1 addition & 1 deletion docs/cli/coder_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down