Skip to content

Commit 2b582a3

Browse files
committed
Extend the default value of --startup-timeout to 1m
Signed-off-by: Kohei Tokunaga <[email protected]>
1 parent 18e64af commit 2b582a3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cmd/nerdctl/builder/builder.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"os"
2222
"os/exec"
2323
"strings"
24+
"time"
2425

2526
"github.com/docker/go-units"
2627
"github.com/spf13/cobra"
@@ -146,6 +147,7 @@ func debugCommand() *cobra.Command {
146147
cmd.Flags().String("image", "", "Image to use for debugging stage")
147148
cmd.Flags().StringArray("ssh", nil, "Allow forwarding SSH agent to the build. Format: default|<id>[=<socket>|<key>[,<key>]]")
148149
cmd.Flags().StringArray("secret", nil, "Expose secret value to the build. Format: id=secretname,src=filepath")
150+
helpers.AddDurationFlag(cmd, "startup-timeout", nil, 1*time.Minute, "", "Timeout for starting up buildg")
149151
return cmd
150152
}
151153

@@ -162,7 +164,16 @@ func debugAction(cmd *cobra.Command, args []string) error {
162164
if err != nil {
163165
return err
164166
}
165-
buildgArgs := []string{"debug"}
167+
168+
buildgArgs := []string{}
169+
170+
startupTimeout, err := cmd.Flags().GetDuration("startup-timeout")
171+
if err != nil {
172+
return err
173+
}
174+
buildgArgs = append(buildgArgs, "--startup-timeout="+startupTimeout.String())
175+
176+
buildgArgs = append(buildgArgs, "debug")
166177
if globalOptions.Debug {
167178
buildgArgs = append([]string{"--debug"}, buildgArgs...)
168179
}

0 commit comments

Comments
 (0)