Merge pull request #84491 from davidz627/fix/verifyLoop

Force file sync after writing file via container in test
This commit is contained in:
Kubernetes Prow Robot
2019-10-30 21:55:50 -07:00
committed by GitHub
2 changed files with 11 additions and 23 deletions

View File

@@ -479,7 +479,7 @@ func (f *Framework) WriteFileViaContainer(podName, containerName string, path st
return fmt.Errorf("Unsupported character in string to write: %v", c)
}
}
command := fmt.Sprintf("echo '%s' > '%s'", contents, path)
command := fmt.Sprintf("echo '%s' > '%s'; sync", contents, path)
stdout, stderr, err := kubectlExecWithRetry(f.Namespace.Name, podName, containerName, "--", "/bin/sh", "-c", command)
if err != nil {
Logf("error running kubectl exec to write file: %v\nstdout=%v\nstderr=%v)", err, string(stdout), string(stderr))