Skip to content

Commit

Permalink
Remove unnecessary select in pod runner (#5436)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdmanv authored and DeepikaDixit committed Apr 22, 2019
1 parent 2339a30 commit e928b88
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/kube/pod_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ func (p *PodRunner) Run(ctx context.Context, fn func(context.Context, *v1.Pod) (
return nil, errors.Wrapf(err, "Failed to create pod")
}
go func() {
select {
case <-ctx.Done():
err := DeletePod(context.Background(), p.cli, pod)
if err != nil {
log.Error("Failed to delete pod ", err.Error())
}
<-ctx.Done()
err := DeletePod(context.Background(), p.cli, pod)
if err != nil {
log.Error("Failed to delete pod ", err.Error())
}
}()
return fn(ctx, pod)
Expand Down

0 comments on commit e928b88

Please sign in to comment.