Merge pull request #113158 from pacoxu/fix-flake-kubectl
kubectl-e2e: the event rendering may have 3 or 4 whitespaces
This commit is contained in:
commit
ab8563b6de
@ -1957,7 +1957,9 @@ metadata:
|
|||||||
ginkgo.By("show started event for this pod")
|
ginkgo.By("show started event for this pod")
|
||||||
events := e2ekubectl.RunKubectlOrDie(ns, "alpha", "events", "--for=pod/"+podName)
|
events := e2ekubectl.RunKubectlOrDie(ns, "alpha", "events", "--for=pod/"+podName)
|
||||||
|
|
||||||
if !strings.Contains(events, fmt.Sprintf("Normal Scheduled Pod/%s", podName)) {
|
// replace multi spaces into single white space
|
||||||
|
eventsStr := strings.Join(strings.Fields(strings.TrimSpace(events)), " ")
|
||||||
|
if !strings.Contains(string(eventsStr), fmt.Sprintf("Normal Scheduled Pod/%s", podName)) {
|
||||||
framework.Failf("failed to list expected event")
|
framework.Failf("failed to list expected event")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user