From 15bc88785a3dd05e3a0b5fc8360f2f82a5ceb709 Mon Sep 17 00:00:00 2001 From: tanjunchen Date: Thu, 13 Feb 2020 20:29:27 +0800 Subject: [PATCH] test/e2e/framework/util.go:make function LookForString private --- test/e2e/framework/util.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 23edde4dcaf..d289f11dcd6 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -607,7 +607,7 @@ func AssertCleanup(ns string, selectors ...string) { // executed in a specific pod container. // TODO(alejandrox1): move to pod/ subpkg once kubectl methods are refactored. func LookForStringInPodExec(ns, podName string, command []string, expectedString string, timeout time.Duration) (result string, err error) { - return LookForString(expectedString, timeout, func() string { + return lookForString(expectedString, timeout, func() string { // use the first container args := []string{"exec", podName, fmt.Sprintf("--namespace=%v", ns), "--"} args = append(args, command...) @@ -615,11 +615,11 @@ func LookForStringInPodExec(ns, podName string, command []string, expectedString }) } -// LookForString looks for the given string in the output of fn, repeatedly calling fn until +// lookForString looks for the given string in the output of fn, repeatedly calling fn until // the timeout is reached or the string is found. Returns last log and possibly // error if the string was not found. // TODO(alejandrox1): move to pod/ subpkg once kubectl methods are refactored. -func LookForString(expectedString string, timeout time.Duration, fn func() string) (result string, err error) { +func lookForString(expectedString string, timeout time.Duration, fn func() string) (result string, err error) { for t := time.Now(); time.Since(t) < timeout; time.Sleep(Poll) { result = fn() if strings.Contains(result, expectedString) { @@ -1570,7 +1570,7 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st // LookForStringInLog looks for the given string in the log of a specific pod container func LookForStringInLog(ns, podName, container, expectedString string, timeout time.Duration) (result string, err error) { - return LookForString(expectedString, timeout, func() string { + return lookForString(expectedString, timeout, func() string { return RunKubectlOrDie(ns, "logs", podName, container, fmt.Sprintf("--namespace=%v", ns)) }) }