From 50a2e83da8654851123a643967be0afdbcee6270 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 14 May 2020 14:05:09 -0700 Subject: [PATCH 1/6] Add additional logging to debug old-k8s-version flake --- test/integration/start_stop_delete_test.go | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 2462c456f2c2..57833d050ea1 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -146,12 +146,43 @@ func TestStartStop(t *testing.T) { func validateFirstStart(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) { defer PostMortemLogs(t, profile) + defer additionalLogs(ctx, t, profile) rr, err := Run(t, exec.CommandContext(ctx, Target(), startArgs...)) if err != nil { t.Fatalf("failed starting minikube -first start-. args %q: %v", rr.Command(), err) } } +func additionalLogs(ctx context.Context, t *testing.T, profile string) { + if !t.Failed() { + return + } + t.Logf("-----------------------additional logs--------------------------------") + rr, err := Run(t, exec.CommandContext(ctx, Target(), []string{"ip", "-p", profile}...)) + if err != nil { + t.Logf("error: %q: %v", rr.Command(), err) + } + t.Log(rr.Output()) + rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"ssh", "-p", profile, "--", "cat", "/etc/hosts"}...)) + if err != nil { + t.Logf("error: %q: %v", rr.Command(), err) + } + t.Log(rr.Output()) + + rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"ssh", "-p", profile, "--", "docker", "images"}...)) + if err != nil { + t.Logf("error: %q: %v", rr.Command(), err) + } + t.Log(rr.Output()) + + rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"kubectl", "-p", profile, "--", "logs", fmt.Sprintf("kube-controller-manager-%s", profile), "-n", "kube-system"}...)) + if err != nil { + t.Logf("error: %q: %v", rr.Command(), err) + } + t.Log(rr.Output()) + t.Logf("-----------------------end additional logs--------------------------------") +} + func validateDeploying(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) { defer PostMortemLogs(t, profile) if !strings.Contains(tcName, "cni") { From b00ef3ae0cf2d29582a1746bab85648cce7a210c Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 15 May 2020 11:34:33 -0700 Subject: [PATCH 2/6] Add additional logs --- test/integration/start_stop_delete_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 57833d050ea1..2f389a050975 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -175,6 +175,12 @@ func additionalLogs(ctx context.Context, t *testing.T, profile string) { } t.Log(rr.Output()) + rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"kubectl", "-p", profile, "--", "get", "po", "-A"}...)) + if err != nil { + t.Logf("error: %q: %v", rr.Command(), err) + } + t.Log(rr.Output()) + rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"kubectl", "-p", profile, "--", "logs", fmt.Sprintf("kube-controller-manager-%s", profile), "-n", "kube-system"}...)) if err != nil { t.Logf("error: %q: %v", rr.Command(), err) From aecd5bb7ef285fa0082da2ade7d28fda36ba342d Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 15 May 2020 12:49:25 -0700 Subject: [PATCH 3/6] fix -A flag, remove flags --- test/integration/start_stop_delete_test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 2f389a050975..03116efb1dbc 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -45,12 +45,7 @@ func TestStartStop(t *testing.T) { 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 - "--kvm-network=default", - "--kvm-qemu-uri=qemu:///system", - "--disable-driver-mounts", - "--keep-context=false", + "--container-runtime=docker", }}, {"newest-cni", constants.NewestKubernetesVersion, []string{ @@ -175,7 +170,7 @@ func additionalLogs(ctx context.Context, t *testing.T, profile string) { } t.Log(rr.Output()) - rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"kubectl", "-p", profile, "--", "get", "po", "-A"}...)) + rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"kubectl", "-p", profile, "--", "get", "po", "--all-namespaces"}...)) if err != nil { t.Logf("error: %q: %v", rr.Command(), err) } From a762d58382237a1096c27935954b30b1a6e49a0e Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 28 May 2020 10:55:53 -0700 Subject: [PATCH 4/6] Skip old-k8s-version on kvm2 --- test/integration/main.go | 5 +++ test/integration/start_stop_delete_test.go | 48 +++++----------------- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/test/integration/main.go b/test/integration/main.go index 7a2865fd0878..cf54584955dd 100644 --- a/test/integration/main.go +++ b/test/integration/main.go @@ -75,6 +75,11 @@ func HyperVDriver() bool { return strings.Contains(*startArgs, "--driver=hyperv") || strings.Contains(*startArgs, "--vm-driver=hyperv") } +// KVMDriver returns whether or not this test is using the KVM driver +func KVMDriver() bool { + return strings.Contains(*startArgs, "--driver=kvm") || strings.Contains(*startArgs, "--vm-driver=kvm") +} + // 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 8d63d022e7e7..ecbd73c972ac 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -45,7 +45,12 @@ func TestStartStop(t *testing.T) { 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 + "--kvm-network=default", + "--kvm-qemu-uri=qemu:///system", + "--disable-driver-mounts", + "--keep-context=false", "--container-runtime=docker", }}, {"newest-cni", constants.NewestKubernetesVersion, []string{ @@ -74,6 +79,10 @@ func TestStartStop(t *testing.T) { for _, tc := range tests { tc := tc t.Run(tc.name, func(t *testing.T) { + // See https://github.com/kubernetes/minikube/issues/8048#issuecomment-635504092 + if tc.name == "old-k8s-version" && KVMDriver() { + t.Skip() + } MaybeParallel(t) profile := UniqueProfileName(tc.name) ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) @@ -141,49 +150,12 @@ func TestStartStop(t *testing.T) { func validateFirstStart(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) { defer PostMortemLogs(t, profile) - defer additionalLogs(ctx, t, profile) rr, err := Run(t, exec.CommandContext(ctx, Target(), startArgs...)) if err != nil { t.Fatalf("failed starting minikube -first start-. args %q: %v", rr.Command(), err) } } -func additionalLogs(ctx context.Context, t *testing.T, profile string) { - if !t.Failed() { - return - } - t.Logf("-----------------------additional logs--------------------------------") - rr, err := Run(t, exec.CommandContext(ctx, Target(), []string{"ip", "-p", profile}...)) - if err != nil { - t.Logf("error: %q: %v", rr.Command(), err) - } - t.Log(rr.Output()) - rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"ssh", "-p", profile, "--", "cat", "/etc/hosts"}...)) - if err != nil { - t.Logf("error: %q: %v", rr.Command(), err) - } - t.Log(rr.Output()) - - rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"ssh", "-p", profile, "--", "docker", "images"}...)) - if err != nil { - t.Logf("error: %q: %v", rr.Command(), err) - } - t.Log(rr.Output()) - - rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"kubectl", "-p", profile, "--", "get", "po", "--all-namespaces"}...)) - if err != nil { - t.Logf("error: %q: %v", rr.Command(), err) - } - t.Log(rr.Output()) - - rr, err = Run(t, exec.CommandContext(ctx, Target(), []string{"kubectl", "-p", profile, "--", "logs", fmt.Sprintf("kube-controller-manager-%s", profile), "-n", "kube-system"}...)) - if err != nil { - t.Logf("error: %q: %v", rr.Command(), err) - } - t.Log(rr.Output()) - t.Logf("-----------------------end additional logs--------------------------------") -} - func validateDeploying(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) { defer PostMortemLogs(t, profile) if !strings.Contains(tcName, "cni") { From fa6c4463742193a9f061e466b59f624792d3f2b1 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 28 May 2020 11:08:07 -0700 Subject: [PATCH 5/6] Bump up major version to 13 --- pkg/minikube/constants/constants.go | 2 +- test/integration/main.go | 5 ----- test/integration/start_stop_delete_test.go | 4 ---- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index c4fc8d7e6f0c..256b655ce69b 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -31,7 +31,7 @@ const ( // NewestKubernetesVersion is the newest Kubernetes version to test against NewestKubernetesVersion = "v1.18.3-beta.0" // OldestKubernetesVersion is the oldest Kubernetes version to test against - OldestKubernetesVersion = "v1.12.0" + OldestKubernetesVersion = "v1.13.0" // DefaultClusterName is the default nane for the k8s cluster DefaultClusterName = "minikube" // DockerDaemonPort is the port Docker daemon listening inside a minikube node (vm or container). diff --git a/test/integration/main.go b/test/integration/main.go index cf54584955dd..7a2865fd0878 100644 --- a/test/integration/main.go +++ b/test/integration/main.go @@ -75,11 +75,6 @@ func HyperVDriver() bool { return strings.Contains(*startArgs, "--driver=hyperv") || strings.Contains(*startArgs, "--vm-driver=hyperv") } -// KVMDriver returns whether or not this test is using the KVM driver -func KVMDriver() bool { - return strings.Contains(*startArgs, "--driver=kvm") || strings.Contains(*startArgs, "--vm-driver=kvm") -} - // 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 ecbd73c972ac..ade1fed0655c 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -79,10 +79,6 @@ func TestStartStop(t *testing.T) { for _, tc := range tests { tc := tc t.Run(tc.name, func(t *testing.T) { - // See https://github.com/kubernetes/minikube/issues/8048#issuecomment-635504092 - if tc.name == "old-k8s-version" && KVMDriver() { - t.Skip() - } MaybeParallel(t) profile := UniqueProfileName(tc.name) ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) From 3b24e6fdbeb25f65fbacb4801acf5b18761b7735 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 28 May 2020 13:59:50 -0700 Subject: [PATCH 6/6] Add info about --force --- cmd/minikube/cmd/start.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index aef199c8dc44..bfaf528faf80 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -976,7 +976,7 @@ func getKubernetesVersion(old *config.ClusterConfig) string { if viper.GetBool(force) { out.WarningT("Kubernetes {{.version}} is not supported by this release of minikube", out.V{"version": nvs}) } else { - exit.WithCodeT(exit.Data, "Sorry, Kubernetes {{.version}} is not supported by this release of minikube", out.V{"version": nvs}) + exit.WithCodeT(exit.Data, "Sorry, Kubernetes {{.version}} is not supported by this release of minikube. To use this version anyway, use the `--force` flag.", out.V{"version": nvs}) } }