diff --git a/test/e2e/framework/pod/create.go b/test/e2e/framework/pod/create.go index 5266a77a455..32d7b0bb11b 100644 --- a/test/e2e/framework/pod/create.go +++ b/test/e2e/framework/pod/create.go @@ -19,7 +19,6 @@ package pod import ( "context" "fmt" - "runtime" "time" v1 "k8s.io/api/core/v1" @@ -167,11 +166,12 @@ func MakeSecPod(podConfig *Config) (*v1.Pod, error) { if podConfig.NS == "" { return nil, fmt.Errorf("Cannot create pod with empty namespace") } - if len(podConfig.Command) == 0 { + if len(podConfig.Command) == 0 && !NodeOSDistroIs("windows") { podConfig.Command = "trap exit TERM; while true; do sleep 1; done" } + podName := "pod-" + string(uuid.NewUUID()) - if podConfig.FsGroup == nil && runtime.GOOS != "windows" { + if podConfig.FsGroup == nil && !NodeOSDistroIs("windows") { podConfig.FsGroup = func(i int64) *int64 { return &i }(1000) diff --git a/test/e2e/framework/pod/utils.go b/test/e2e/framework/pod/utils.go index 865c93b9053..a5b9991f3ac 100644 --- a/test/e2e/framework/pod/utils.go +++ b/test/e2e/framework/pod/utils.go @@ -40,6 +40,9 @@ func NodeOSDistroIs(distro string) bool { // Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh func GenerateScriptCmd(command string) []string { var commands []string + if command == "" { + return commands + } if !NodeOSDistroIs("windows") { commands = []string{"/bin/sh", "-c", command} } else {