Commit a7b63e1a authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #36723 from dims/fix-matchcontainer-output-retry

Automatic merge from submit-queue Cleanup pod in MatchContainerOutput MatchContainerOutput always creates a pod and does not cleanup. We need to fix this to be better at re-trying the scenarios. When there is an error say in the first attempt of ExpectNoErrorWithRetries (for example in "Pods should contain environment variables for services" test) the retries logic calls MatchContainerOutput another time and the podClient.create fails correctly since the pod was not cleaned up the first time MatchContainerOutput was called. Fixes #35089
parents 4528bcd2 d4a91220
......@@ -2163,6 +2163,10 @@ func (f *Framework) MatchContainerOutput(
ns := f.Namespace.Name
createdPod := podClient.Create(pod)
defer func() {
By("delete the pod")
podClient.DeleteSync(createdPod.Name, &api.DeleteOptions{}, podNoLongerRunningTimeout)
}()
// Wait for client pod to complete.
if err := WaitForPodSuccessInNamespace(f.ClientSet, createdPod.Name, ns); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment