We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf1ad2b commit f39229eCopy full SHA for f39229e
pkg/commands/run.go
@@ -246,12 +246,14 @@ func (c *runCommand) execute(_ *cobra.Command, _ []string) {
246
}
247
}()
248
249
- ctx := context.Background()
+ ctx, cancel := context.WithCancel(context.Background())
250
if c.cfg.Run.Timeout > 0 {
251
- var cancel context.CancelFunc
252
ctx, cancel = context.WithTimeout(ctx, c.cfg.Run.Timeout)
253
- defer cancel()
254
+ defer cancel()
+
255
+ deadline, ok := ctx.Deadline()
256
+ fmt.Println(deadline, ok)
257
258
if needTrackResources {
259
go watchResources(ctx, trackResourcesEndCh, c.log, c.debugf)
0 commit comments