@@ -1064,13 +1064,13 @@ func NodeHasTaint(c clientset.Interface, nodeName string, taint *v1.Taint) (bool
1064
1064
// RunHostCmd runs the given cmd in the context of the given pod using `kubectl exec`
1065
1065
// inside of a shell.
1066
1066
func RunHostCmd (ns , name , cmd string ) (string , error ) {
1067
- return RunKubectl (ns , "exec" , fmt . Sprintf ( "--namespace=%v" , ns ), name , "--" , "/bin/sh" , "-x" , "-c" , cmd )
1067
+ return RunKubectl (ns , "exec" , name , "--" , "/bin/sh" , "-x" , "-c" , cmd )
1068
1068
}
1069
1069
1070
1070
// RunHostCmdWithFullOutput runs the given cmd in the context of the given pod using `kubectl exec`
1071
1071
// inside of a shell. It will also return the command's stderr.
1072
1072
func RunHostCmdWithFullOutput (ns , name , cmd string ) (string , string , error ) {
1073
- return RunKubectlWithFullOutput (ns , "exec" , fmt . Sprintf ( "--namespace=%v" , ns ), name , "--" , "/bin/sh" , "-x" , "-c" , cmd )
1073
+ return RunKubectlWithFullOutput (ns , "exec" , name , "--" , "/bin/sh" , "-x" , "-c" , cmd )
1074
1074
}
1075
1075
1076
1076
// RunHostCmdOrDie calls RunHostCmd and dies on error.
@@ -1148,7 +1148,7 @@ func AllNodesReady(c clientset.Interface, timeout time.Duration) error {
1148
1148
// LookForStringInLog looks for the given string in the log of a specific pod container
1149
1149
func LookForStringInLog (ns , podName , container , expectedString string , timeout time.Duration ) (result string , err error ) {
1150
1150
return lookForString (expectedString , timeout , func () string {
1151
- return RunKubectlOrDie (ns , "logs" , podName , container , fmt . Sprintf ( "--namespace=%v" , ns ) )
1151
+ return RunKubectlOrDie (ns , "logs" , podName , container )
1152
1152
})
1153
1153
}
1154
1154
@@ -1274,18 +1274,18 @@ func GetAllMasterAddresses(c clientset.Interface) []string {
1274
1274
// CreateEmptyFileOnPod creates empty file at given path on the pod.
1275
1275
// TODO(alejandrox1): move to subpkg pod once kubectl methods have been refactored.
1276
1276
func CreateEmptyFileOnPod (namespace string , podName string , filePath string ) error {
1277
- _ , err := RunKubectl (namespace , "exec" , fmt . Sprintf ( "--namespace=%s" , namespace ), podName , "--" , "/bin/sh" , "-c" , fmt .Sprintf ("touch %s" , filePath ))
1277
+ _ , err := RunKubectl (namespace , "exec" , podName , "--" , "/bin/sh" , "-c" , fmt .Sprintf ("touch %s" , filePath ))
1278
1278
return err
1279
1279
}
1280
1280
1281
1281
// DumpDebugInfo dumps debug info of tests.
1282
1282
func DumpDebugInfo (c clientset.Interface , ns string ) {
1283
1283
sl , _ := c .CoreV1 ().Pods (ns ).List (context .TODO (), metav1.ListOptions {LabelSelector : labels .Everything ().String ()})
1284
1284
for _ , s := range sl .Items {
1285
- desc , _ := RunKubectl (ns , "describe" , "po" , s .Name , fmt . Sprintf ( "--namespace=%v" , ns ) )
1285
+ desc , _ := RunKubectl (ns , "describe" , "po" , s .Name )
1286
1286
Logf ("\n Output of kubectl describe %v:\n %v" , s .Name , desc )
1287
1287
1288
- l , _ := RunKubectl (ns , "logs" , s .Name , fmt . Sprintf ( "--namespace=%v" , ns ), "--tail=100" )
1288
+ l , _ := RunKubectl (ns , "logs" , s .Name , "--tail=100" )
1289
1289
Logf ("\n Last 100 log lines of %v:\n %v" , s .Name , l )
1290
1290
}
1291
1291
}
0 commit comments