@@ -478,14 +478,14 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
478
478
479
479
By ("creating a file in subpath" )
480
480
cmd := "touch /volume_mount/mypath/foo/test.log"
481
- _ , err = framework . RunHostCmd ( pod . Namespace , pod .Name , cmd )
481
+ _ , _ , err = f . ExecShellInPodWithFullOutput ( pod .Name , cmd )
482
482
if err != nil {
483
483
framework .Failf ("expected to be able to write to subpath" )
484
484
}
485
485
486
486
By ("test for file in mounted path" )
487
487
cmd = "test -f /subpath_mount/test.log"
488
- _ , err = framework . RunHostCmd ( pod . Namespace , pod .Name , cmd )
488
+ _ , _ , err = f . ExecShellInPodWithFullOutput ( pod .Name , cmd )
489
489
if err != nil {
490
490
framework .Failf ("expected to be able to verify file" )
491
491
}
@@ -625,13 +625,13 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
625
625
626
626
By ("test for subpath mounted with old value" )
627
627
cmd := "test -f /volume_mount/foo/test.log"
628
- _ , err = framework . RunHostCmd ( pod . Namespace , pod .Name , cmd )
628
+ _ , _ , err = f . ExecShellInPodWithFullOutput ( pod .Name , cmd )
629
629
if err != nil {
630
630
framework .Failf ("expected to be able to verify old file exists" )
631
631
}
632
632
633
633
cmd = "test ! -f /volume_mount/newsubpath/test.log"
634
- _ , err = framework . RunHostCmd ( pod . Namespace , pod .Name , cmd )
634
+ _ , _ , err = f . ExecShellInPodWithFullOutput ( pod .Name , cmd )
635
635
if err != nil {
636
636
framework .Failf ("expected to be able to verify new file does not exist" )
637
637
}
@@ -656,9 +656,9 @@ func testPodFailSubpath(f *framework.Framework, pod *v1.Pod) {
656
656
func waitForPodContainerRestart (f * framework.Framework , pod * v1.Pod , volumeMount string ) {
657
657
658
658
By ("Failing liveness probe" )
659
- 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 ))
659
+ stdout , stderr , err := f . ExecShellInPodWithFullOutput ( pod .Name , fmt .Sprintf ("rm %v" , volumeMount ))
660
660
661
- framework .Logf ("Pod exec output: %v" , out )
661
+ framework .Logf ("Pod exec output: %v / %v " , stdout , stderr )
662
662
Expect (err ).ToNot (HaveOccurred (), "while failing liveness probe" )
663
663
664
664
// Check that container has restarted
@@ -685,8 +685,8 @@ func waitForPodContainerRestart(f *framework.Framework, pod *v1.Pod, volumeMount
685
685
686
686
// Fix liveness probe
687
687
By ("Rewriting the file" )
688
- 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 ))
689
- framework .Logf ("Pod exec output: %v" , out )
688
+ stdout , _ , err = f . ExecShellInPodWithFullOutput ( pod .Name , fmt .Sprintf ("echo test-after > %v" , volumeMount ))
689
+ framework .Logf ("Pod exec output: %v" , stdout )
690
690
Expect (err ).ToNot (HaveOccurred (), "while rewriting the probe file" )
691
691
692
692
// Wait for container restarts to stabilize
0 commit comments