Skip to content

Commit

Permalink
Revert context used for deleting a kube pod (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronH88 authored May 22, 2024
1 parent 6b713a1 commit a5b193e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/workceptor/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ func (kw *KubeUnit) Restart() error {
if err != nil {
kw.GetWorkceptor().nc.GetLogger().Warning("Pod %s could not be deleted: %s", ked.PodName, err.Error())
} else {
err := KubeAPIWrapperInstance.Delete(kw.GetContext(), kw.clientset, ked.KubeNamespace, ked.PodName, metav1.DeleteOptions{})
err := KubeAPIWrapperInstance.Delete(context.Background(), kw.clientset, ked.KubeNamespace, ked.PodName, metav1.DeleteOptions{})
if err != nil {
kw.GetWorkceptor().nc.GetLogger().Warning("Pod %s could not be deleted: %s", ked.PodName, err.Error())
}
Expand All @@ -1438,7 +1438,7 @@ func (kw *KubeUnit) Cancel() error {
kw.CancelContext()
kw.UpdateBasicStatus(WorkStateCanceled, "Canceled", -1)
if kw.pod != nil {
err := KubeAPIWrapperInstance.Delete(kw.GetContext(), kw.clientset, kw.pod.Namespace, kw.pod.Name, metav1.DeleteOptions{})
err := KubeAPIWrapperInstance.Delete(context.Background(), kw.clientset, kw.pod.Namespace, kw.pod.Name, metav1.DeleteOptions{})
if err != nil {
kw.GetWorkceptor().nc.GetLogger().Error("Error deleting pod %s: %s", kw.pod.Name, err)
}
Expand Down

0 comments on commit a5b193e

Please sign in to comment.