Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit611db66

Browse files
committed
Revert "confirm before stop"
This reverts commitc33f9b9.
1 parentc33f9b9 commit611db66

File tree

2 files changed

+9
-26
lines changed

2 files changed

+9
-26
lines changed

‎cli/update.go

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,13 @@ func (r *RootCmd) update() *serpent.Command {
3939
// updating. Simply performing a new start transition may not work if the
4040
// template specifies ignore_changes.
4141
ifworkspace.LatestBuild.Transition==codersdk.WorkspaceTransitionStart {
42-
// It's polite to ask the user before stopping their workspace.
43-
cliui.Info(inv.Stdout,"Your workspace is currently running. We recommend stopping it before proceeding.")
44-
if_,err:=cliui.Prompt(inv, cliui.PromptOptions{
45-
Text:"Confirm stop workspace?",
46-
IsConfirm:true,
47-
});err!=nil {
48-
cliui.Warnf(inv.Stderr,"Updating without stop.")
49-
}else {
50-
build,err:=stopWorkspace(inv,client,workspace,bflags)
51-
iferr!=nil {
52-
returnxerrors.Errorf("stop workspace: %w",err)
53-
}
54-
// Wait for the stop to complete.
55-
iferr:=cliui.WorkspaceBuild(inv.Context(),inv.Stdout,client,build.ID);err!=nil {
56-
returnxerrors.Errorf("wait for stop: %w",err)
57-
}
42+
build,err:=stopWorkspace(inv,client,workspace,bflags)
43+
iferr!=nil {
44+
returnxerrors.Errorf("stop workspace: %w",err)
45+
}
46+
// Wait for the stop to complete.
47+
iferr:=cliui.WorkspaceBuild(inv.Context(),inv.Stdout,client,build.ID);err!=nil {
48+
returnxerrors.Errorf("wait for stop: %w",err)
5849
}
5950
}
6051

‎cli/update_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,8 @@ func TestUpdate(t *testing.T) {
7171
inv,root:=clitest.New(t,"update",ws.Name)
7272
clitest.SetupConfig(t,member,root)
7373

74-
doneCh:=make(chanerror)
75-
pty:=ptytest.New(t).Attach(inv)
76-
gofunc() {
77-
deferclose(doneCh)
78-
doneCh<-inv.Run()
79-
}()
80-
81-
pty.ExpectMatch("Confirm stop workspace?")
82-
pty.WriteLine("yes")
83-
require.NoError(t,testutil.TryReceive(ctx,t,doneCh),"update command failed to run")
74+
err=inv.Run()
75+
require.NoError(t,err,"update command failed")
8476

8577
// Then: the workspace is no longer 'outdated'
8678
ws,err=member.WorkspaceByOwnerAndName(ctx,codersdk.Me,"my-workspace", codersdk.WorkspaceOptions{})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp