Merge pull request #74805 from HotelsDotCom/feature/remove-kubectl-binary

VolumeSubpathEnvExpansion alpha tests - change kubectl references to API calls
pull/564/head
Kubernetes Prow Robot 2019-03-02 03:41:15 -08:00 committed by GitHub
commit 6b2882738b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -478,14 +478,14 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
By("creating a file in subpath")
cmd := "touch /volume_mount/mypath/foo/test.log"
_, err = framework.RunHostCmd(pod.Namespace, pod.Name, cmd)
_, _, err = f.ExecShellInPodWithFullOutput(pod.Name, cmd)
if err != nil {
framework.Failf("expected to be able to write to subpath")
}
By("test for file in mounted path")
cmd = "test -f /subpath_mount/test.log"
_, err = framework.RunHostCmd(pod.Namespace, pod.Name, cmd)
_, _, err = f.ExecShellInPodWithFullOutput(pod.Name, cmd)
if err != nil {
framework.Failf("expected to be able to verify file")
}
@ -625,13 +625,13 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
By("test for subpath mounted with old value")
cmd := "test -f /volume_mount/foo/test.log"
_, err = framework.RunHostCmd(pod.Namespace, pod.Name, cmd)
_, _, err = f.ExecShellInPodWithFullOutput(pod.Name, cmd)
if err != nil {
framework.Failf("expected to be able to verify old file exists")
}
cmd = "test ! -f /volume_mount/newsubpath/test.log"
_, err = framework.RunHostCmd(pod.Namespace, pod.Name, cmd)
_, _, err = f.ExecShellInPodWithFullOutput(pod.Name, cmd)
if err != nil {
framework.Failf("expected to be able to verify new file does not exist")
}
@ -656,9 +656,9 @@ func testPodFailSubpath(f *framework.Framework, pod *v1.Pod) {
func waitForPodContainerRestart(f *framework.Framework, pod *v1.Pod, volumeMount string) {
By("Failing liveness probe")
out, err := framework.RunKubectl("exec", fmt.Sprintf("--namespace=%s", pod.Namespace), pod.Name, "--container", pod.Spec.Containers[0].Name, "--", "/bin/sh", "-c", fmt.Sprintf("rm %v", volumeMount))
stdout, stderr, err := f.ExecShellInPodWithFullOutput(pod.Name, fmt.Sprintf("rm %v", volumeMount))
framework.Logf("Pod exec output: %v", out)
framework.Logf("Pod exec output: %v / %v", stdout, stderr)
Expect(err).ToNot(HaveOccurred(), "while failing liveness probe")
// Check that container has restarted
@ -685,8 +685,8 @@ func waitForPodContainerRestart(f *framework.Framework, pod *v1.Pod, volumeMount
// Fix liveness probe
By("Rewriting the file")
out, err = framework.RunKubectl("exec", fmt.Sprintf("--namespace=%s", pod.Namespace), pod.Name, "--container", pod.Spec.Containers[0].Name, "--", "/bin/sh", "-c", fmt.Sprintf("echo test-after > %v", volumeMount))
framework.Logf("Pod exec output: %v", out)
stdout, _, err = f.ExecShellInPodWithFullOutput(pod.Name, fmt.Sprintf("echo test-after > %v", volumeMount))
framework.Logf("Pod exec output: %v", stdout)
Expect(err).ToNot(HaveOccurred(), "while rewriting the probe file")
// Wait for container restarts to stabilize