mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: 'coder update' should always start a workspace (#6437)
* fix: 'coder update' should always start a workspace
This commit is contained in:
Vendored
+1
-1
@@ -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
@@ -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
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user