Only run TestOffline for specified container runtime
parent
2f81d4874f
commit
e2359569e4
|
@ -33,7 +33,9 @@ func TestOffline(t *testing.T) {
|
|||
rt := rt
|
||||
t.Run(rt, func(t *testing.T) {
|
||||
MaybeParallel(t)
|
||||
|
||||
if requestedRuntime := ContainerRuntime(); requestedRuntime != "" && requestedRuntime != rt {
|
||||
t.Skipf("skipping test for container runtime %s, only testing runtime %s", rt, requestedRuntime)
|
||||
}
|
||||
if rt != "docker" && arm64Platform() {
|
||||
t.Skipf("skipping %s - only docker runtime supported on arm64. See https://github.com/kubernetes/minikube/issues/10144", t.Name())
|
||||
}
|
||||
|
|
|
@ -124,6 +124,20 @@ func PodmanDriver() bool {
|
|||
return strings.Contains(*startArgs, "--vm-driver=podman") || strings.Contains(*startArgs, "driver=podman")
|
||||
}
|
||||
|
||||
// ContainerRuntime returns the name of a specific container runtime if it was specified
|
||||
func ContainerRuntime() string {
|
||||
flag := "--container-runtime="
|
||||
if !strings.Contains(*startArgs, flag) {
|
||||
return ""
|
||||
}
|
||||
for _, s := range StartArgs() {
|
||||
if strings.HasPrefix(s, flag) {
|
||||
return strings.TrimPrefix(s, flag)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// KicDriver returns whether or not this test is using the docker or podman driver
|
||||
func KicDriver() bool {
|
||||
return DockerDriver() || PodmanDriver()
|
||||
|
|
Loading…
Reference in New Issue