Skip to content

Commit

Permalink
Log error during pod delete (#5432)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepikaDixit authored and Ilya Kislenko committed Apr 18, 2019
1 parent fba04ea commit 2339a30
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/kube/pod_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
"k8s.io/client-go/kubernetes"
)
Expand Down Expand Up @@ -36,7 +37,10 @@ func (p *PodRunner) Run(ctx context.Context, fn func(context.Context, *v1.Pod) (
go func() {
select {
case <-ctx.Done():
defer DeletePod(context.Background(), p.cli, pod)
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 2339a30

Please sign in to comment.