File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -238,19 +238,17 @@ func (c *runCommand) execute(_ *cobra.Command, args []string) {
238
238
needTrackResources := logutils .IsVerbose () || c .opts .PrintResourcesUsage
239
239
240
240
trackResourcesEndCh := make (chan struct {})
241
- defer func () { // XXX: this defer must be before ctx.cancel defer
241
+ defer func () { // XXX: this defer must be before ctx.cancel defer
242
242
if needTrackResources { // wait until resource tracking finished to print properly
243
243
<- trackResourcesEndCh
244
244
}
245
245
}()
246
246
247
- var ctx context.Context
247
+ ctx := context .Background ()
248
248
if c .cfg .Run .Timeout > 0 {
249
249
var cancel context.CancelFunc
250
- ctx , cancel = context .WithTimeout (context . Background () , c .cfg .Run .Timeout )
250
+ ctx , cancel = context .WithTimeout (ctx , c .cfg .Run .Timeout )
251
251
defer cancel ()
252
- } else {
253
- ctx = context .Background ()
254
252
}
255
253
256
254
if needTrackResources {
You can’t perform that action at this time.
0 commit comments