Skip to content

Commit

Permalink
fix(scheduler): Create new context when starting background routine f…
Browse files Browse the repository at this point in the history
…or pod checks (#148)

Signed-off-by: Florian Bacher <[email protected]>
  • Loading branch information
bacherfl authored Oct 12, 2022
1 parent 9fd210d commit 543ca87
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scheduler/pkg/klcpermit/permit.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ func (pl *Permit) Permit(ctx context.Context, state *framework.CycleState, p *v1
return framework.NewStatus(framework.Success), 0 * time.Second
default:
klog.Infof("[Keptn Permit Plugin] waiting for pre-deployment checks on %s", p.GetObjectMeta().GetName())
go pl.monitorPod(ctx, p)
go func() {
// create a new context since we are in a new goroutine
ctx2, cancel := context.WithCancel(context.Background())
defer cancel()
pl.monitorPod(ctx2, p)
}()
return framework.NewStatus(framework.Wait), 5 * time.Minute
}

Expand Down

0 comments on commit 543ca87

Please sign in to comment.