Merge pull request #84411 from jfbai/move-funcs-of-framework-to-common

Move funcs of framework to common runtimeclass.
This commit is contained in:
Kubernetes Prow Robot 2019-10-29 21:18:52 -07:00 committed by GitHub
commit d0d4572c82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,11 +22,9 @@ limitations under the License.
package framework
import (
"bufio"
"bytes"
"fmt"
"math/rand"
"os"
"strings"
"sync"
"time"
@ -866,18 +864,6 @@ func (cl *ClusterVerification) ForEach(podFunc func(v1.Pod)) error {
return err
}
// GetLogToFileFunc is a convenience function that returns a function that have the same interface as
// e2elog.Logf, but writes to a specified file.
func GetLogToFileFunc(file *os.File) func(format string, args ...interface{}) {
return func(format string, args ...interface{}) {
writer := bufio.NewWriter(file)
if _, err := fmt.Fprintf(writer, format, args...); err != nil {
Logf("Failed to write file %v with test performance data: %v", file.Name(), err)
}
writer.Flush()
}
}
const (
// preconfiguredRuntimeHandler is the name of the runtime handler that is expected to be
// preconfigured in the test environment.