Skip to content
Merged
Changes from 1 commit
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
10 changes: 8 additions & 2 deletions pkg/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,14 @@ func (c *runCommand) execute(_ *cobra.Command, args []string) {
}
}()

ctx, cancel := context.WithTimeout(context.Background(), c.cfg.Run.Timeout)
defer cancel()
var ctx context.Context
if c.cfg.Run.Timeout > 0 {
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(context.Background(), c.cfg.Run.Timeout)
defer cancel()
} else {
ctx = context.Background()
}

if needTrackResources {
go watchResources(ctx, trackResourcesEndCh, c.log, c.debugf)
Expand Down
Loading