mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat(cli): add --provisioner-log-debug
option (#14558)
Allows starting a build in debug mode from the CLI without needing to have the build fail first by adding `--provisioner-log-debug`.
This commit is contained in:
11
cli/stop.go
11
cli/stop.go
@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func (r *RootCmd) stop() *serpent.Command {
|
||||
var bflags buildFlags
|
||||
client := new(codersdk.Client)
|
||||
cmd := &serpent.Command{
|
||||
Annotations: workspaceCommand,
|
||||
@ -35,9 +36,13 @@ func (r *RootCmd) stop() *serpent.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
build, err := client.CreateWorkspaceBuild(inv.Context(), workspace.ID, codersdk.CreateWorkspaceBuildRequest{
|
||||
wbr := codersdk.CreateWorkspaceBuildRequest{
|
||||
Transition: codersdk.WorkspaceTransitionStop,
|
||||
})
|
||||
}
|
||||
if bflags.provisionerLogDebug {
|
||||
wbr.LogLevel = codersdk.ProvisionerLogLevelDebug
|
||||
}
|
||||
build, err := client.CreateWorkspaceBuild(inv.Context(), workspace.ID, wbr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -56,5 +61,7 @@ func (r *RootCmd) stop() *serpent.Command {
|
||||
return nil
|
||||
},
|
||||
}
|
||||
cmd.Options = append(cmd.Options, bflags.cliOptions()...)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
Reference in New Issue
Block a user