Skip to content

Commit

Permalink
Before DeletingPods we need to wait for LogStreaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBergmeier6176 committed Nov 9, 2024
1 parent c0a10c9 commit 3db8d94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/gke/test/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ func NewPodRun(tb testing.TB, clientset *kubernetes.Clientset, ctx context.Conte
}

func (pr *PodRun) DeletePod(clientset *kubernetes.Clientset, ctx context.Context) error {
pods := clientset.CoreV1().Pods(pr.Pod.Namespace)
pr.logStreaming.Wait()

pods := clientset.CoreV1().Pods(pr.Pod.Namespace)
return pods.Delete(ctx, pr.Pod.Name, metav1.DeleteOptions{})
}

// Close waits until there is no more output to stream.
func (pr *PodRun) Close() error {
pr.logStreaming.Wait()

return nil
}

0 comments on commit 3db8d94

Please sign in to comment.