Skip to content
Open
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
5 changes: 4 additions & 1 deletion cmd/compose/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func runStart(ctx context.Context, dockerCli command.Cli, backendOptions *Backen
return err
}

timeout := time.Duration(opts.waitTimeout) * time.Second
var timeout time.Duration
if opts.waitTimeout > 0 {
timeout = time.Duration(opts.waitTimeout) * time.Second
}
return backend.Start(ctx, name, api.StartOptions{
AttachTo: services,
Project: project,
Expand Down
8 changes: 7 additions & 1 deletion cmd/compose/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *Backend

//nolint:gocyclo
func validateFlags(up *upOptions, create *createOptions) error {
if up.waitTimeout < 0 {
return fmt.Errorf("--wait-timeout must be a non-negative integer")
}
if up.exitCodeFrom != "" && !up.cascadeFail {
up.cascadeStop = true
}
Expand Down Expand Up @@ -328,7 +331,10 @@ func runUp(
attach = attachSet.Elements()
}

timeout := time.Duration(upOptions.waitTimeout) * time.Second
var timeout time.Duration
if upOptions.waitTimeout > 0 {
timeout = time.Duration(upOptions.waitTimeout) * time.Second
}
return backend.Up(ctx, project, api.UpOptions{
Create: create,
Start: api.StartOptions{
Expand Down