From b50dfe1c063de9cef0e1f09b72962ac752fd1830 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 20 Jan 2021 16:23:19 -0800 Subject: [PATCH 01/14] Split up TestStartStop by container runtime --- test/integration/main_test.go | 15 ++ test/integration/start_stop_delete_test.go | 157 +++++++++++---------- 2 files changed, 99 insertions(+), 73 deletions(-) diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 65ee8f5707..86ac1b46c6 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -124,6 +124,21 @@ 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 "" + } + split := strings.Split(*startArgs, ",") + for _, s := range split { + 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() diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 30250b61d3..84fcd9fb27 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -38,12 +38,12 @@ import ( func TestStartStop(t *testing.T) { MaybeParallel(t) - t.Run("group", func(t *testing.T) { - tests := []struct { - name string - version string - args []string - }{ + tests := map[string][]struct { + name string + version string + args []string + }{ + "docker": { {"old-k8s-version", constants.OldestKubernetesVersion, []string{ // default is the network created by libvirt, if we change the name minikube won't boot // because the given network doesn't exist @@ -60,93 +60,104 @@ func TestStartStop(t *testing.T) { "--extra-config=kubelet.network-plugin=cni", "--extra-config=kubeadm.pod-network-cidr=192.168.111.111/16", }}, + {"embed-certs", constants.DefaultKubernetesVersion, []string{ + "--embed-certs", + }}, + }, + "containerd": { {"containerd", constants.DefaultKubernetesVersion, []string{ "--container-runtime=containerd", "--docker-opt", "containerd=/var/run/containerd/containerd.sock", "--apiserver-port=8444", }}, + }, + "crio": { {"crio", "v1.15.7", []string{ "--container-runtime=crio", "--disable-driver-mounts", "--extra-config=kubeadm.ignore-preflight-errors=SystemVerification", }}, - {"embed-certs", constants.DefaultKubernetesVersion, []string{ - "--embed-certs", - }}, - } + }, + } - for _, tc := range tests { - tc := tc - t.Run(tc.name, func(t *testing.T) { - MaybeParallel(t) - profile := UniqueProfileName(tc.name) - ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) - defer Cleanup(t, profile, cancel) - type validateStartStopFunc func(context.Context, *testing.T, string, string, string, []string) - if !strings.Contains(tc.name, "docker") && NoneDriver() { - t.Skipf("skipping %s - incompatible with none driver", t.Name()) - } - - waitFlag := "--wait=true" - if strings.Contains(tc.name, "cni") { // wait=app_running is broken for CNI https://github.com/kubernetes/minikube/issues/7354 - waitFlag = "--wait=apiserver,system_pods,default_sa" - } - - startArgs := append([]string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", waitFlag}, tc.args...) - startArgs = append(startArgs, StartArgs()...) - startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", tc.version)) - - t.Run("serial", func(t *testing.T) { - serialTests := []struct { - name string - validator validateStartStopFunc - }{ - {"FirstStart", validateFirstStart}, - {"DeployApp", validateDeploying}, - {"Stop", validateStop}, - {"EnableAddonAfterStop", validateEnableAddonAfterStop}, - {"SecondStart", validateSecondStart}, - {"UserAppExistsAfterStop", validateAppExistsAfterStop}, - {"AddonExistsAfterStop", validateAddonAfterStop}, - {"VerifyKubernetesImages", validateKubernetesImages}, - {"Pause", validatePauseAfterStart}, - } - for _, stc := range serialTests { - if ctx.Err() == context.DeadlineExceeded { - t.Fatalf("Unable to run more tests (deadline exceeded)") - } - - tcName := tc.name - tcVersion := tc.version - stc := stc - - t.Run(stc.name, func(t *testing.T) { - stc.validator(ctx, t, profile, tcName, tcVersion, startArgs) - }) + for cr, tcs := range tests { + t.Run(cr, func(t *testing.T) { + if runtime := ContainerRuntime(); runtime != "" && runtime != cr { + t.Skipf("skipping test for container runtime %s, only testing runtime %s", cr, runtime) + } + for _, tc := range tcs { + tc := tc + t.Run(tc.name, func(t *testing.T) { + profile := UniqueProfileName(tc.name) + ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) + defer Cleanup(t, profile, cancel) + type validateStartStopFunc func(context.Context, *testing.T, string, string, string, []string) + if !strings.Contains(tc.name, "docker") && NoneDriver() { + t.Skipf("skipping %s - incompatible with none driver", t.Name()) } - if *cleanup { - // Normally handled by cleanuprofile, but not fatal there - rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "-p", profile)) - if err != nil { - t.Errorf("failed to clean up: args %q: %v", rr.Command(), err) + waitFlag := "--wait=true" + if strings.Contains(tc.name, "cni") { // wait=app_running is broken for CNI https://github.com/kubernetes/minikube/issues/7354 + waitFlag = "--wait=apiserver,system_pods,default_sa" + } + + startArgs := append([]string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", waitFlag}, tc.args...) + startArgs = append(startArgs, StartArgs()...) + startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", tc.version)) + + t.Run("serial", func(t *testing.T) { + serialTests := []struct { + name string + validator validateStartStopFunc + }{ + {"FirstStart", validateFirstStart}, + {"DeployApp", validateDeploying}, + {"Stop", validateStop}, + {"EnableAddonAfterStop", validateEnableAddonAfterStop}, + {"SecondStart", validateSecondStart}, + {"UserAppExistsAfterStop", validateAppExistsAfterStop}, + {"AddonExistsAfterStop", validateAddonAfterStop}, + {"VerifyKubernetesImages", validateKubernetesImages}, + {"Pause", validatePauseAfterStart}, + } + for _, stc := range serialTests { + if ctx.Err() == context.DeadlineExceeded { + t.Fatalf("Unable to run more tests (deadline exceeded)") + } + + tcName := tc.name + tcVersion := tc.version + stc := stc + + t.Run(stc.name, func(t *testing.T) { + stc.validator(ctx, t, profile, tcName, tcVersion, startArgs) + }) } - rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "config", "get-contexts", profile)) - if err != nil { - t.Logf("config context error: %v (may be ok)", err) + if *cleanup { + // Normally handled by cleanuprofile, but not fatal there + rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "-p", profile)) + if err != nil { + t.Errorf("failed to clean up: args %q: %v", rr.Command(), err) + } + + rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "config", "get-contexts", profile)) + if err != nil { + t.Logf("config context error: %v (may be ok)", err) + } + if rr.ExitCode != 1 { + t.Errorf("expected exit code 1, got %d. output: %s", rr.ExitCode, rr.Output()) + } } - if rr.ExitCode != 1 { - t.Errorf("expected exit code 1, got %d. output: %s", rr.ExitCode, rr.Output()) - } - } + + }) }) - }) - } - }) + } + }) + } } func validateFirstStart(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) { From 0bdd034c90c0acf3d6145944fed866039a4bb5fe Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 20 Jan 2021 16:51:59 -0800 Subject: [PATCH 02/14] update container runtime --- test/integration/main_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 86ac1b46c6..12083bf8c3 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -130,8 +130,7 @@ func ContainerRuntime() string { if !strings.Contains(*startArgs, flag) { return "" } - split := strings.Split(*startArgs, ",") - for _, s := range split { + for _, s := range StartArgs() { if strings.HasPrefix(s, flag) { return strings.TrimPrefix(s, flag) } From e308d72fc28fd8e3785f7829f59e3baa7be7f735 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 21 Jan 2021 12:02:28 -0800 Subject: [PATCH 03/14] Run all start/stop tests against all runtimes --- hack/jenkins/common.sh | 4 +- test/integration/start_stop_delete_test.go | 170 ++++++++++----------- 2 files changed, 80 insertions(+), 94 deletions(-) diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index 0182427673..a2a3b09944 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -301,8 +301,10 @@ if test -f "${TEST_OUT}"; then fi touch "${TEST_OUT}" -if [ ! -z "${CONTAINER_RUNTIME}" ] +if [ -z "${CONTAINER_RUNTIME}" ] then + EXTRA_START_ARGS="${EXTRA_START_ARGS} --container-runtime=docker" +else EXTRA_START_ARGS="${EXTRA_START_ARGS} --container-runtime=${CONTAINER_RUNTIME}" fi diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 84fcd9fb27..f69172b875 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -38,12 +38,12 @@ import ( func TestStartStop(t *testing.T) { MaybeParallel(t) - tests := map[string][]struct { - name string - version string - args []string - }{ - "docker": { + t.Run("group", func(t *testing.T) { + tests := []struct { + name string + version string + args []string + }{ {"old-k8s-version", constants.OldestKubernetesVersion, []string{ // default is the network created by libvirt, if we change the name minikube won't boot // because the given network doesn't exist @@ -51,7 +51,6 @@ func TestStartStop(t *testing.T) { "--kvm-qemu-uri=qemu:///system", "--disable-driver-mounts", "--keep-context=false", - "--container-runtime=docker", }}, {"newest-cni", constants.NewestKubernetesVersion, []string{ "--feature-gates", @@ -60,104 +59,89 @@ func TestStartStop(t *testing.T) { "--extra-config=kubelet.network-plugin=cni", "--extra-config=kubeadm.pod-network-cidr=192.168.111.111/16", }}, - {"embed-certs", constants.DefaultKubernetesVersion, []string{ - "--embed-certs", - }}, - }, - "containerd": { - {"containerd", constants.DefaultKubernetesVersion, []string{ - "--container-runtime=containerd", - "--docker-opt", - "containerd=/var/run/containerd/containerd.sock", + {"default_k8s_version", constants.DefaultKubernetesVersion, []string{ "--apiserver-port=8444", }}, - }, - "crio": { - {"crio", "v1.15.7", []string{ - "--container-runtime=crio", + {"disable_driver_mounts", "v1.15.7", []string{ "--disable-driver-mounts", "--extra-config=kubeadm.ignore-preflight-errors=SystemVerification", }}, - }, - } + {"embed-certs", constants.DefaultKubernetesVersion, []string{ + "--embed-certs", + }}, + } - for cr, tcs := range tests { - t.Run(cr, func(t *testing.T) { - if runtime := ContainerRuntime(); runtime != "" && runtime != cr { - t.Skipf("skipping test for container runtime %s, only testing runtime %s", cr, runtime) - } - for _, tc := range tcs { - tc := tc - t.Run(tc.name, func(t *testing.T) { - profile := UniqueProfileName(tc.name) - ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) - defer Cleanup(t, profile, cancel) - type validateStartStopFunc func(context.Context, *testing.T, string, string, string, []string) - if !strings.Contains(tc.name, "docker") && NoneDriver() { - t.Skipf("skipping %s - incompatible with none driver", t.Name()) + for _, tc := range tests { + tc := tc + t.Run(tc.name, func(t *testing.T) { + MaybeParallel(t) + profile := UniqueProfileName(tc.name) + ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) + defer Cleanup(t, profile, cancel) + type validateStartStopFunc func(context.Context, *testing.T, string, string, string, []string) + if !strings.Contains(tc.name, "docker") && NoneDriver() { + t.Skipf("skipping %s - incompatible with none driver", t.Name()) + } + + waitFlag := "--wait=true" + if strings.Contains(tc.name, "cni") { // wait=app_running is broken for CNI https://github.com/kubernetes/minikube/issues/7354 + waitFlag = "--wait=apiserver,system_pods,default_sa" + } + + startArgs := append([]string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", waitFlag}, tc.args...) + startArgs = append(startArgs, StartArgs()...) + startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", tc.version)) + + t.Run("serial", func(t *testing.T) { + serialTests := []struct { + name string + validator validateStartStopFunc + }{ + {"FirstStart", validateFirstStart}, + {"DeployApp", validateDeploying}, + {"Stop", validateStop}, + {"EnableAddonAfterStop", validateEnableAddonAfterStop}, + {"SecondStart", validateSecondStart}, + {"UserAppExistsAfterStop", validateAppExistsAfterStop}, + {"AddonExistsAfterStop", validateAddonAfterStop}, + {"VerifyKubernetesImages", validateKubernetesImages}, + {"Pause", validatePauseAfterStart}, + } + for _, stc := range serialTests { + if ctx.Err() == context.DeadlineExceeded { + t.Fatalf("Unable to run more tests (deadline exceeded)") + } + + tcName := tc.name + tcVersion := tc.version + stc := stc + + t.Run(stc.name, func(t *testing.T) { + stc.validator(ctx, t, profile, tcName, tcVersion, startArgs) + }) } - waitFlag := "--wait=true" - if strings.Contains(tc.name, "cni") { // wait=app_running is broken for CNI https://github.com/kubernetes/minikube/issues/7354 - waitFlag = "--wait=apiserver,system_pods,default_sa" + if *cleanup { + // Normally handled by cleanuprofile, but not fatal there + rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "-p", profile)) + if err != nil { + t.Errorf("failed to clean up: args %q: %v", rr.Command(), err) + } + + rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "config", "get-contexts", profile)) + if err != nil { + t.Logf("config context error: %v (may be ok)", err) + } + if rr.ExitCode != 1 { + t.Errorf("expected exit code 1, got %d. output: %s", rr.ExitCode, rr.Output()) + } } - startArgs := append([]string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", waitFlag}, tc.args...) - startArgs = append(startArgs, StartArgs()...) - startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", tc.version)) - - t.Run("serial", func(t *testing.T) { - serialTests := []struct { - name string - validator validateStartStopFunc - }{ - {"FirstStart", validateFirstStart}, - {"DeployApp", validateDeploying}, - {"Stop", validateStop}, - {"EnableAddonAfterStop", validateEnableAddonAfterStop}, - {"SecondStart", validateSecondStart}, - {"UserAppExistsAfterStop", validateAppExistsAfterStop}, - {"AddonExistsAfterStop", validateAddonAfterStop}, - {"VerifyKubernetesImages", validateKubernetesImages}, - {"Pause", validatePauseAfterStart}, - } - for _, stc := range serialTests { - if ctx.Err() == context.DeadlineExceeded { - t.Fatalf("Unable to run more tests (deadline exceeded)") - } - - tcName := tc.name - tcVersion := tc.version - stc := stc - - t.Run(stc.name, func(t *testing.T) { - stc.validator(ctx, t, profile, tcName, tcVersion, startArgs) - }) - } - - if *cleanup { - // Normally handled by cleanuprofile, but not fatal there - rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "-p", profile)) - if err != nil { - t.Errorf("failed to clean up: args %q: %v", rr.Command(), err) - } - - rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "config", "get-contexts", profile)) - if err != nil { - t.Logf("config context error: %v (may be ok)", err) - } - if rr.ExitCode != 1 { - t.Errorf("expected exit code 1, got %d. output: %s", rr.ExitCode, rr.Output()) - } - } - - }) - }) - } - }) - } + }) + } + }) } func validateFirstStart(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) { From d6ce7c4997660906f21934da33178513b17183f0 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 21 Jan 2021 12:03:11 -0800 Subject: [PATCH 04/14] remove unused function --- test/integration/main_test.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/test/integration/main_test.go b/test/integration/main_test.go index cb1b7bb420..d6dfda30b2 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -124,20 +124,6 @@ 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() From 3f0dac34c509c796fb294b7a1bf1e8859cbc6225 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 21 Jan 2021 12:36:53 -0800 Subject: [PATCH 05/14] update docs --- site/content/en/docs/commands/start.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/en/docs/commands/start.md b/site/content/en/docs/commands/start.md index 13505e4190..e45bf8ecf2 100644 --- a/site/content/en/docs/commands/start.md +++ b/site/content/en/docs/commands/start.md @@ -26,7 +26,7 @@ minikube start [flags] --apiserver-names strings A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine --apiserver-port int The apiserver listening port (default 8443) --auto-update-drivers If set, automatically updates drivers to the latest version. Defaults to true. (default true) - --base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase:v0.0.16-snapshot1@sha256:dff16232547bb3ac3f2a9e09a42246a96ecf8f40d9a1c5bcf5a37953690954b6") + --base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase:v0.0.17@sha256:1cd2e039ec9d418e6380b2fa0280503a72e5b282adea674ee67882f59f4f546e") --cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none. (default true) --cni string CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto) --container-runtime string The container runtime to be used (docker, cri-o, containerd). (default "docker") @@ -64,7 +64,7 @@ minikube start [flags] --insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added. --install-addons If set, install addons. Defaults to true. (default true) --interactive Allow user prompts for more information (default true) - --iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube/iso/minikube-v1.16.0.iso,https://github.com/kubernetes/minikube/releases/download/v1.16.0/minikube-v1.16.0.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.16.0.iso]) + --iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube/iso/minikube-v1.17.0.iso,https://github.com/kubernetes/minikube/releases/download/v1.17.0/minikube-v1.17.0.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.17.0.iso]) --keep-context This will keep the existing kubectl context and will create a minikube context. --kubernetes-version string The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.20.0, 'latest' for v1.20.0). Defaults to 'stable'. --kvm-gpu Enable experimental NVIDIA GPU support in minikube From 71855d60616476a0f1b05efb7e59a4b441479f20 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 21 Jan 2021 14:40:08 -0800 Subject: [PATCH 06/14] only run disable mounts with virtualbox driver --- test/integration/main_test.go | 5 +++++ test/integration/start_stop_delete_test.go | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/integration/main_test.go b/test/integration/main_test.go index d6dfda30b2..9b7358811a 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -114,6 +114,11 @@ func HyperVDriver() bool { return strings.Contains(*startArgs, "--driver=hyperv") || strings.Contains(*startArgs, "--vm-driver=hyperv") } +// VirtualboxDriver returns whether or not this test is using the VirtualBox driver +func VirtualboxDriver() bool { + return strings.Contains(*startArgs, "--driver=virtualbox") || strings.Contains(*startArgs, "--vm-driver=virtualbox") +} + // DockerDriver returns whether or not this test is using the docker or podman driver func DockerDriver() bool { return strings.Contains(*startArgs, "--driver=docker") || strings.Contains(*startArgs, "--vm-driver=docker") diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index f69172b875..c34f83cc9a 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -59,9 +59,7 @@ func TestStartStop(t *testing.T) { "--extra-config=kubelet.network-plugin=cni", "--extra-config=kubeadm.pod-network-cidr=192.168.111.111/16", }}, - {"default_k8s_version", constants.DefaultKubernetesVersion, []string{ - "--apiserver-port=8444", - }}, + {"default_k8s_version", constants.DefaultKubernetesVersion, []string{}}, {"disable_driver_mounts", "v1.15.7", []string{ "--disable-driver-mounts", "--extra-config=kubeadm.ignore-preflight-errors=SystemVerification", @@ -82,6 +80,9 @@ func TestStartStop(t *testing.T) { if !strings.Contains(tc.name, "docker") && NoneDriver() { t.Skipf("skipping %s - incompatible with none driver", t.Name()) } + if strings.Contains(tc.name, "disable_driver_mounts") && !VirtualboxDriver() { + t.Skipf("skipping %s - only runs on virtualbox", t.Name()) + } waitFlag := "--wait=true" if strings.Contains(tc.name, "cni") { // wait=app_running is broken for CNI https://github.com/kubernetes/minikube/issues/7354 From 073d31ff23f0c5ba6a8a0a68fa6500a9f961a6d5 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 21 Jan 2021 16:23:22 -0800 Subject: [PATCH 07/14] replace underscores with dashes because minikube profile names can't have underscores --- test/integration/start_stop_delete_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index c34f83cc9a..d726549867 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -59,8 +59,8 @@ func TestStartStop(t *testing.T) { "--extra-config=kubelet.network-plugin=cni", "--extra-config=kubeadm.pod-network-cidr=192.168.111.111/16", }}, - {"default_k8s_version", constants.DefaultKubernetesVersion, []string{}}, - {"disable_driver_mounts", "v1.15.7", []string{ + {"default-k8s-version", constants.DefaultKubernetesVersion, []string{}}, + {"disable-driver-mounts", "v1.15.7", []string{ "--disable-driver-mounts", "--extra-config=kubeadm.ignore-preflight-errors=SystemVerification", }}, From 90cfe8331a74bdf8696789b99da9b4f55b2b41c1 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 11:40:25 -0800 Subject: [PATCH 08/14] fix test --- test/integration/start_stop_delete_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 521be93ad7..b4e82e9e99 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -59,7 +59,9 @@ func TestStartStop(t *testing.T) { "--extra-config=kubelet.network-plugin=cni", "--extra-config=kubeadm.pod-network-cidr=192.168.111.111/16", }}, - {"default-k8s-version", constants.DefaultKubernetesVersion, []string{}}, + {"default-k8s-different-port", constants.DefaultKubernetesVersion, []string{ + "--apiserver-port=8444", + }}, {"disable-driver-mounts", "v1.15.7", []string{ "--disable-driver-mounts", "--extra-config=kubeadm.ignore-preflight-errors=SystemVerification", From c32633d4b3c70e33f77e36088bd9143c8fbb35d4 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 11:42:42 -0800 Subject: [PATCH 09/14] don't explicitly pass runtime if not specified --- hack/jenkins/common.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index a2a3b09944..0182427673 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -301,10 +301,8 @@ if test -f "${TEST_OUT}"; then fi touch "${TEST_OUT}" -if [ -z "${CONTAINER_RUNTIME}" ] +if [ ! -z "${CONTAINER_RUNTIME}" ] then - EXTRA_START_ARGS="${EXTRA_START_ARGS} --container-runtime=docker" -else EXTRA_START_ARGS="${EXTRA_START_ARGS} --container-runtime=${CONTAINER_RUNTIME}" fi From fcf84b6f39933ec9932049e4d1ca9d1557c29394 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 12:03:17 -0800 Subject: [PATCH 10/14] add no preload --- test/integration/start_stop_delete_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index b4e82e9e99..421704175a 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -62,7 +62,10 @@ func TestStartStop(t *testing.T) { {"default-k8s-different-port", constants.DefaultKubernetesVersion, []string{ "--apiserver-port=8444", }}, - {"disable-driver-mounts", "v1.15.7", []string{ + {"no-preload", constants.DefaultKubernetesVersion, []string{ + "--preload=false", + }}, + {"disable-driver-mounts", constants.DefaultKubernetesVersion, []string{ "--disable-driver-mounts", "--extra-config=kubeadm.ignore-preflight-errors=SystemVerification", }}, From 7290095872b673b1051e9c9d9a8a2e7064cd9b4c Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 13:08:18 -0800 Subject: [PATCH 11/14] test no preload with newest k8s version --- test/integration/start_stop_delete_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 421704175a..eddf853684 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -62,7 +62,7 @@ func TestStartStop(t *testing.T) { {"default-k8s-different-port", constants.DefaultKubernetesVersion, []string{ "--apiserver-port=8444", }}, - {"no-preload", constants.DefaultKubernetesVersion, []string{ + {"no-preload", constants.NewestKubernetesVersion, []string{ "--preload=false", }}, {"disable-driver-mounts", constants.DefaultKubernetesVersion, []string{ From 2b7cab10fb2b6cc5617e3f3ad34d4f06020680ef Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 16:05:34 -0800 Subject: [PATCH 12/14] Add JSON step for CNI to fix failing TestJSONOutput test --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 1 + pkg/minikube/out/register/register.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index 5baf460eb6..ad0348aa40 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -328,6 +328,7 @@ func (k *Bootstrapper) applyCNI(cfg config.ClusterConfig) error { return nil } + register.Reg.SetStep(register.ConfiguringCNI) out.Step(style.CNI, "Configuring {{.name}} (Container Networking Interface) ...", out.V{"name": cnm.String()}) if err := cnm.Apply(k.c); err != nil { diff --git a/pkg/minikube/out/register/register.go b/pkg/minikube/out/register/register.go index 6b810b0e30..4e1c580bac 100644 --- a/pkg/minikube/out/register/register.go +++ b/pkg/minikube/out/register/register.go @@ -41,6 +41,7 @@ const ( PreparingKubernetesCerts RegStep = "Generating certificates" PreparingKubernetesControlPlane RegStep = "Booting control plane" PreparingKubernetesBootstrapToken RegStep = "Configuring RBAC rules" + ConfiguringCNI RegStep = "Configuring CNI" VerifyingKubernetes RegStep = "Verifying Kubernetes" EnablingAddons RegStep = "Enabling Addons" Done RegStep = "Done" @@ -85,6 +86,7 @@ func init() { PreparingKubernetesCerts, PreparingKubernetesControlPlane, PreparingKubernetesBootstrapToken, + ConfiguringCNI, ConfiguringLHEnv, VerifyingKubernetes, EnablingAddons, From 37dd783dd87b036e806c68cb8cd6aa9cd2d99157 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 25 Jan 2021 11:03:24 -0800 Subject: [PATCH 13/14] Fix position of Configuring CNI --- pkg/minikube/out/register/register.go | 2 +- test/integration/json_output_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/minikube/out/register/register.go b/pkg/minikube/out/register/register.go index 4e1c580bac..e71bdee167 100644 --- a/pkg/minikube/out/register/register.go +++ b/pkg/minikube/out/register/register.go @@ -82,11 +82,11 @@ func init() { CreatingContainer, CreatingVM, RunningRemotely, + ConfiguringCNI, PreparingKubernetes, PreparingKubernetesCerts, PreparingKubernetesControlPlane, PreparingKubernetesBootstrapToken, - ConfiguringCNI, ConfiguringLHEnv, VerifyingKubernetes, EnablingAddons, diff --git a/test/integration/json_output_test.go b/test/integration/json_output_test.go index 01dfa6feb3..3363754cf2 100644 --- a/test/integration/json_output_test.go +++ b/test/integration/json_output_test.go @@ -122,7 +122,7 @@ func validateIncreasingCurrentSteps(ctx context.Context, t *testing.T, ces []*cl } } -func TestJSONOutputError(t *testing.T) { +func TestErrorJSONOutput(t *testing.T) { profile := UniqueProfileName("json-output-error") ctx, cancel := context.WithTimeout(context.Background(), Minutes(2)) defer Cleanup(t, profile, cancel) From a9f435b757082fe0bc142cf9289f920b35030c80 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 25 Jan 2021 11:39:06 -0800 Subject: [PATCH 14/14] put step in correct place --- pkg/minikube/out/register/register.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/out/register/register.go b/pkg/minikube/out/register/register.go index e71bdee167..4e1c580bac 100644 --- a/pkg/minikube/out/register/register.go +++ b/pkg/minikube/out/register/register.go @@ -82,11 +82,11 @@ func init() { CreatingContainer, CreatingVM, RunningRemotely, - ConfiguringCNI, PreparingKubernetes, PreparingKubernetesCerts, PreparingKubernetesControlPlane, PreparingKubernetesBootstrapToken, + ConfiguringCNI, ConfiguringLHEnv, VerifyingKubernetes, EnablingAddons,