Merge pull request #71428 from mkimuram/issue/71383

Fix subpath test flake that is caused in testPodFailSubpathError
pull/58/head
k8s-ci-robot 2018-11-26 15:43:33 -08:00 committed by GitHub
commit ce68cfa453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -1496,10 +1496,12 @@ func eventOccurred(c clientset.Interface, podName, namespace, eventSelector, msg
if err != nil {
return false, fmt.Errorf("got error while getting pod events: %s", err)
}
if len(events.Items) == 0 {
return false, nil // no events have occurred yet
for _, event := range events.Items {
if strings.Contains(event.Message, msg) {
return true, nil
}
}
return strings.Contains(events.Items[0].Message, msg), nil
return false, nil
}
}

View File

@ -587,8 +587,6 @@ func testPodFailSubpathError(f *framework.Framework, pod *v1.Pod, errorMsg strin
defer func() {
framework.DeletePodWithWait(f, f.ClientSet, pod)
}()
err = framework.WaitForPodRunningInNamespace(f.ClientSet, pod)
Expect(err).To(HaveOccurred(), "while waiting for pod to be running")
By("Checking for subpath error event")
selector := fields.Set{