From aed36e2947bc13e4e22e0302144444a35d66eede Mon Sep 17 00:00:00 2001 From: tstromberg Date: Fri, 18 Dec 2020 08:01:17 -0800 Subject: [PATCH 01/21] Makefile: Make Debian/RedHat package revisions settable --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 38d46b9071..76d5cb1d1d 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,10 @@ KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f ISO_VERSION ?= v1.16.0 # Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta DEB_VERSION ?= $(subst -,~,$(RAW_VERSION)) +DEB_REVISION ?= 0 + RPM_VERSION ?= $(DEB_VERSION) +RPM_REVISION ?= 0 # used by hack/jenkins/release_build_and_upload.sh and KVM_BUILD_IMAGE, see also BUILD_IMAGE below GO_VERSION ?= 1.15.5 @@ -461,12 +464,12 @@ out/docs/minikube.md: $(shell find "cmd") $(shell find "pkg/minikube/constants") go run -ldflags="$(MINIKUBE_LDFLAGS)" -tags gendocs hack/help_text/gen_help_text.go deb_version: - @echo $(DEB_VERSION) + @echo $(DEB_VERSION)-$(DEB_REVISION) -out/minikube_$(DEB_VERSION).deb: out/minikube_$(DEB_VERSION)-0_amd64.deb +out/minikube_$(DEB_VERSION).deb: out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_amd64.deb cp $< $@ -out/minikube_$(DEB_VERSION)-0_%.deb: out/minikube-linux-% +out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_%.deb: out/minikube-linux-% cp -r installers/linux/deb/minikube_deb_template out/minikube_$(DEB_VERSION) chmod 0755 out/minikube_$(DEB_VERSION)/DEBIAN sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control @@ -484,7 +487,7 @@ out/minikube_$(DEB_VERSION)-0_%.deb: out/minikube-linux-% rpm_version: @echo $(RPM_VERSION) -out/minikube-$(RPM_VERSION).rpm: out/minikube-$(RPM_VERSION)-0.x86_64.rpm +out/minikube-$(RPM_VERSION).rpm: out/minikube-$(RPM_VERSION)-$(RPM_REVISION).x86_64.rpm cp $< $@ out/minikube-$(RPM_VERSION)-0.%.rpm: out/minikube-linux-% @@ -493,7 +496,7 @@ out/minikube-$(RPM_VERSION)-0.%.rpm: out/minikube-linux-% sed -E -i 's|--OUT--|'$(PWD)/out'|g' out/minikube-$(RPM_VERSION)/minikube.spec rpmbuild -bb -D "_rpmdir $(PWD)/out" --target $* \ out/minikube-$(RPM_VERSION)/minikube.spec - @mv out/$*/minikube-$(RPM_VERSION)-0.$*.rpm out/ && rmdir out/$* + @mv out/$*/minikube-$(RPM_VERSION)-$(RPM_REVISION).$*.rpm out/ && rmdir out/$* rm -rf out/minikube-$(RPM_VERSION) .PHONY: apt From c14734c69cec49f5b47f4453abe5910e01de51cc Mon Sep 17 00:00:00 2001 From: Jorropo Date: Sun, 20 Dec 2020 04:09:47 +0100 Subject: [PATCH 02/21] fix: debian and arch concurrents multiarch builds Signed-off-by: Jorropo --- Makefile | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 38d46b9071..37fab4ece6 100644 --- a/Makefile +++ b/Makefile @@ -396,6 +396,7 @@ clean: ## Clean build rm -f pkg/minikube/assets/assets.go rm -f pkg/minikube/translate/translations.go rm -rf ./vendor + rm -rf /tmp/tmp.*.minikube_* .PHONY: gendocs gendocs: out/docs/minikube.md ## Generate documentation @@ -467,19 +468,20 @@ out/minikube_$(DEB_VERSION).deb: out/minikube_$(DEB_VERSION)-0_amd64.deb cp $< $@ out/minikube_$(DEB_VERSION)-0_%.deb: out/minikube-linux-% - cp -r installers/linux/deb/minikube_deb_template out/minikube_$(DEB_VERSION) - chmod 0755 out/minikube_$(DEB_VERSION)/DEBIAN - sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control - sed -E -i 's/--ARCH--/'$*'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control + $(eval DEB_PACKAGING_DIRECTORY_$*=$(shell mktemp -d --suffix ".minikube_$(DEB_VERSION)-$*-deb")) + cp -r installers/linux/deb/minikube_deb_template/* $(DEB_PACKAGING_DIRECTORY_$*)/ + chmod 0755 $(DEB_PACKAGING_DIRECTORY_$*)/DEBIAN + sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' $(DEB_PACKAGING_DIRECTORY_$*)/DEBIAN/control + sed -E -i 's/--ARCH--/'$*'/g' $(DEB_PACKAGING_DIRECTORY_$*)/DEBIAN/control if [ "$*" = "amd64" ]; then \ - sed -E -i 's/--RECOMMENDS--/virtualbox/' out/minikube_$(DEB_VERSION)/DEBIAN/control; \ + sed -E -i 's/--RECOMMENDS--/virtualbox/' $(DEB_PACKAGING_DIRECTORY_$*)/DEBIAN/control; \ else \ - sed -E -i '/Recommends: --RECOMMENDS--/d' out/minikube_$(DEB_VERSION)/DEBIAN/control; \ + sed -E -i '/Recommends: --RECOMMENDS--/d' $(DEB_PACKAGING_DIRECTORY_$*)/DEBIAN/control; \ fi - mkdir -p out/minikube_$(DEB_VERSION)/usr/bin - cp $< out/minikube_$(DEB_VERSION)/usr/bin/minikube - fakeroot dpkg-deb --build out/minikube_$(DEB_VERSION) $@ - rm -rf out/minikube_$(DEB_VERSION) + mkdir -p $(DEB_PACKAGING_DIRECTORY_$*)/usr/bin + cp $< $(DEB_PACKAGING_DIRECTORY_$*)/usr/bin/minikube + fakeroot dpkg-deb --build $(DEB_PACKAGING_DIRECTORY_$*) $@ + rm -rf $(DEB_PACKAGING_DIRECTORY_$*) rpm_version: @echo $(RPM_VERSION) @@ -488,13 +490,14 @@ out/minikube-$(RPM_VERSION).rpm: out/minikube-$(RPM_VERSION)-0.x86_64.rpm cp $< $@ out/minikube-$(RPM_VERSION)-0.%.rpm: out/minikube-linux-% - cp -r installers/linux/rpm/minikube_rpm_template out/minikube-$(RPM_VERSION) - sed -E -i 's/--VERSION--/'$(RPM_VERSION)'/g' out/minikube-$(RPM_VERSION)/minikube.spec - sed -E -i 's|--OUT--|'$(PWD)/out'|g' out/minikube-$(RPM_VERSION)/minikube.spec + $(eval RPM_PACKAGING_DIRECTORY_$*=$(shell mktemp -d --suffix ".minikube_$(RPM_VERSION)-$*-rpm")) + cp -r installers/linux/rpm/minikube_rpm_template/* $(RPM_PACKAGING_DIRECTORY_$*)/ + sed -E -i 's/--VERSION--/'$(RPM_VERSION)'/g' $(RPM_PACKAGING_DIRECTORY_$*)/minikube.spec + sed -E -i 's|--OUT--|'$(PWD)/out'|g' $(RPM_PACKAGING_DIRECTORY_$*)/minikube.spec rpmbuild -bb -D "_rpmdir $(PWD)/out" --target $* \ - out/minikube-$(RPM_VERSION)/minikube.spec + $(RPM_PACKAGING_DIRECTORY_$*)/minikube.spec @mv out/$*/minikube-$(RPM_VERSION)-0.$*.rpm out/ && rmdir out/$* - rm -rf out/minikube-$(RPM_VERSION) + rm -rf $(RPM_PACKAGING_DIRECTORY_$*) .PHONY: apt apt: out/Release ## Generate apt package file From e2359569e422d80c365155802f314b45b80d30df Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 20 Jan 2021 16:50:03 -0800 Subject: [PATCH 03/21] Only run TestOffline for specified container runtime --- test/integration/aab_offline_test.go | 4 +++- test/integration/main_test.go | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/test/integration/aab_offline_test.go b/test/integration/aab_offline_test.go index ced6b5da2d..d41e682f23 100644 --- a/test/integration/aab_offline_test.go +++ b/test/integration/aab_offline_test.go @@ -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()) } diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 65ee8f5707..12083bf8c3 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -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() From 8214b3849fc9e252b906bb9b9f0cda6bac336d30 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 20 Jan 2021 16:55:23 -0800 Subject: [PATCH 04/21] Include TestDownloadOnly --- test/integration/aaa_download_only_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/aaa_download_only_test.go b/test/integration/aaa_download_only_test.go index b39d98bae1..9105c0d63c 100644 --- a/test/integration/aaa_download_only_test.go +++ b/test/integration/aaa_download_only_test.go @@ -42,6 +42,9 @@ import ( func TestDownloadOnly(t *testing.T) { for _, r := range []string{"crio", "docker", "containerd"} { t.Run(r, func(t *testing.T) { + if requestedRuntime := ContainerRuntime(); requestedRuntime != "" && requestedRuntime != rt { + t.Skipf("skipping test for container runtime %s, only testing runtime %s", rt, requestedRuntime) + } // Stores the startup run result for later error messages var rrr *RunResult From dd6d845dcca654fa985e46d84a58d43358bcd849 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 21 Jan 2021 10:56:28 -0800 Subject: [PATCH 05/21] Fix var --- test/integration/aaa_download_only_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/aaa_download_only_test.go b/test/integration/aaa_download_only_test.go index 9105c0d63c..444e44bbdd 100644 --- a/test/integration/aaa_download_only_test.go +++ b/test/integration/aaa_download_only_test.go @@ -42,8 +42,8 @@ import ( func TestDownloadOnly(t *testing.T) { for _, r := range []string{"crio", "docker", "containerd"} { t.Run(r, func(t *testing.T) { - if requestedRuntime := ContainerRuntime(); requestedRuntime != "" && requestedRuntime != rt { - t.Skipf("skipping test for container runtime %s, only testing runtime %s", rt, requestedRuntime) + if requestedRuntime := ContainerRuntime(); requestedRuntime != "" && requestedRuntime != r { + t.Skipf("skipping test for container runtime %s, only testing runtime %s", r, requestedRuntime) } // Stores the startup run result for later error messages var rrr *RunResult From 0591fbd5575508f35b3a0322c8a2580a07065ce2 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 21 Jan 2021 12:12:33 -0800 Subject: [PATCH 06/21] Remove container runtime info from tests --- hack/jenkins/common.sh | 4 +- test/integration/aaa_download_only_test.go | 223 ++++++++++----------- test/integration/aab_offline_test.go | 59 +++--- 3 files changed, 137 insertions(+), 149 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/aaa_download_only_test.go b/test/integration/aaa_download_only_test.go index 444e44bbdd..da79eecfd2 100644 --- a/test/integration/aaa_download_only_test.go +++ b/test/integration/aaa_download_only_test.go @@ -40,134 +40,129 @@ import ( ) func TestDownloadOnly(t *testing.T) { - for _, r := range []string{"crio", "docker", "containerd"} { - t.Run(r, func(t *testing.T) { - if requestedRuntime := ContainerRuntime(); requestedRuntime != "" && requestedRuntime != r { - t.Skipf("skipping test for container runtime %s, only testing runtime %s", r, requestedRuntime) + // Stores the startup run result for later error messages + var rrr *RunResult + + profile := UniqueProfileName("download-only") + ctx, cancel := context.WithTimeout(context.Background(), Minutes(30)) + defer Cleanup(t, profile, cancel) + containerRuntime := ContainerRuntime() + + versions := []string{ + constants.OldestKubernetesVersion, + constants.DefaultKubernetesVersion, + constants.NewestKubernetesVersion, + } + + for _, v := range versions { + t.Run(v, func(t *testing.T) { + defer PostMortemLogs(t, profile) + + // --force to avoid uid check + args := append([]string{"start", "-o=json", "--download-only", "-p", profile, "--force", "--alsologtostderr", fmt.Sprintf("--kubernetes-version=%s", v)}, StartArgs()...) + + rt, err := Run(t, exec.CommandContext(ctx, Target(), args...)) + if rrr == nil { + // Preserve the initial run-result for debugging + rrr = rt } - // Stores the startup run result for later error messages - var rrr *RunResult - - profile := UniqueProfileName(r) - ctx, cancel := context.WithTimeout(context.Background(), Minutes(30)) - defer Cleanup(t, profile, cancel) - - versions := []string{ - constants.OldestKubernetesVersion, - constants.DefaultKubernetesVersion, - constants.NewestKubernetesVersion, + if err != nil { + t.Errorf("failed to download only. args: %q %v", args, err) } - - for _, v := range versions { - t.Run(v, func(t *testing.T) { - defer PostMortemLogs(t, profile) - - // --force to avoid uid check - args := append([]string{"start", "-o=json", "--download-only", "-p", profile, "--force", "--alsologtostderr", fmt.Sprintf("--kubernetes-version=%s", v), fmt.Sprintf("--container-runtime=%s", r)}, StartArgs()...) - - rt, err := Run(t, exec.CommandContext(ctx, Target(), args...)) - if rrr == nil { - // Preserve the initial run-result for debugging - rrr = rt - } + t.Run("check json events", func(t *testing.T) { + s := bufio.NewScanner(bytes.NewReader(rt.Stdout.Bytes())) + for s.Scan() { + var rtObj map[string]interface{} + err = json.Unmarshal(s.Bytes(), &rtObj) if err != nil { - t.Errorf("failed to download only. args: %q %v", args, err) - } - t.Run("check json events", func(t *testing.T) { - s := bufio.NewScanner(bytes.NewReader(rt.Stdout.Bytes())) - for s.Scan() { - var rtObj map[string]interface{} - err = json.Unmarshal(s.Bytes(), &rtObj) - if err != nil { - t.Errorf("failed to parse output: %v", err) - } else if step, ok := rtObj["data"]; ok { - if stepMap, ok := step.(map[string]interface{}); ok { - if stepMap["currentstep"] == "" { - t.Errorf("Empty step number for %v", stepMap["name"]) - } - } - } - } - }) - - // skip for none, as none driver does not have preload feature. - if !NoneDriver() { - if download.PreloadExists(v, r, true) { - // Just make sure the tarball path exists - if _, err := os.Stat(download.TarballPath(v, r)); err != nil { - t.Errorf("failed to verify preloaded tarball file exists: %v", err) - } - return - } - } - imgs, err := images.Kubeadm("", v) - if err != nil { - t.Errorf("failed to get kubeadm images for %v: %+v", v, err) - } - - // skip verify for cache images if --driver=none - if !NoneDriver() { - for _, img := range imgs { - img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2 - fp := filepath.Join(localpath.MiniPath(), "cache", "images", img) - _, err := os.Stat(fp) - if err != nil { - t.Errorf("expected image file exist at %q but got error: %v", fp, err) + t.Errorf("failed to parse output: %v", err) + } else if step, ok := rtObj["data"]; ok { + if stepMap, ok := step.(map[string]interface{}); ok { + if stepMap["currentstep"] == "" { + t.Errorf("Empty step number for %v", stepMap["name"]) } } } - - // checking binaries downloaded (kubelet,kubeadm) - for _, bin := range constants.KubernetesReleaseBinaries { - fp := filepath.Join(localpath.MiniPath(), "cache", "linux", v, bin) - _, err := os.Stat(fp) - if err != nil { - t.Errorf("expected the file for binary exist at %q but got error %v", fp, err) - } - } - - // If we are on darwin/windows, check to make sure OS specific kubectl has been downloaded - // as well for the `minikube kubectl` command - if runtime.GOOS == "linux" { - return - } - binary := "kubectl" - if runtime.GOOS == "windows" { - binary = "kubectl.exe" - } - fp := filepath.Join(localpath.MiniPath(), "cache", runtime.GOOS, v, binary) - if _, err := os.Stat(fp); err != nil { - t.Errorf("expected the file for binary exist at %q but got error %v", fp, err) - } - }) - } - - // This is a weird place to test profile deletion, but this test is serial, and we have a profile to delete! - t.Run("DeleteAll", func(t *testing.T) { - defer PostMortemLogs(t, profile) - - if !CanCleanup() { - t.Skip("skipping, as cleanup is disabled") - } - rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "--all")) - if err != nil { - t.Errorf("failed to delete all. args: %q : %v", rr.Command(), err) } }) - // Delete should always succeed, even if previously partially or fully deleted. - t.Run("DeleteAlwaysSucceeds", func(t *testing.T) { - defer PostMortemLogs(t, profile) - if !CanCleanup() { - t.Skip("skipping, as cleanup is disabled") + // skip for none, as none driver does not have preload feature. + if !NoneDriver() { + if download.PreloadExists(v, containerRuntime, true) { + // Just make sure the tarball path exists + if _, err := os.Stat(download.TarballPath(v, containerRuntime)); err != nil { + t.Errorf("failed to verify preloaded tarball file exists: %v", err) + } + return } - rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "-p", profile)) + } + imgs, err := images.Kubeadm("", v) + if err != nil { + t.Errorf("failed to get kubeadm images for %v: %+v", v, err) + } + + // skip verify for cache images if --driver=none + if !NoneDriver() { + for _, img := range imgs { + img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2 + fp := filepath.Join(localpath.MiniPath(), "cache", "images", img) + _, err := os.Stat(fp) + if err != nil { + t.Errorf("expected image file exist at %q but got error: %v", fp, err) + } + } + } + + // checking binaries downloaded (kubelet,kubeadm) + for _, bin := range constants.KubernetesReleaseBinaries { + fp := filepath.Join(localpath.MiniPath(), "cache", "linux", v, bin) + _, err := os.Stat(fp) if err != nil { - t.Errorf("failed to delete. args: %q: %v", rr.Command(), err) + t.Errorf("expected the file for binary exist at %q but got error %v", fp, err) } - }) + } + + // If we are on darwin/windows, check to make sure OS specific kubectl has been downloaded + // as well for the `minikube kubectl` command + if runtime.GOOS == "linux" { + return + } + binary := "kubectl" + if runtime.GOOS == "windows" { + binary = "kubectl.exe" + } + fp := filepath.Join(localpath.MiniPath(), "cache", runtime.GOOS, v, binary) + if _, err := os.Stat(fp); err != nil { + t.Errorf("expected the file for binary exist at %q but got error %v", fp, err) + } }) } + + // This is a weird place to test profile deletion, but this test is serial, and we have a profile to delete! + t.Run("DeleteAll", func(t *testing.T) { + defer PostMortemLogs(t, profile) + + if !CanCleanup() { + t.Skip("skipping, as cleanup is disabled") + } + rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "--all")) + if err != nil { + t.Errorf("failed to delete all. args: %q : %v", rr.Command(), err) + } + }) + // Delete should always succeed, even if previously partially or fully deleted. + t.Run("DeleteAlwaysSucceeds", func(t *testing.T) { + defer PostMortemLogs(t, profile) + + if !CanCleanup() { + t.Skip("skipping, as cleanup is disabled") + } + rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "-p", profile)) + if err != nil { + t.Errorf("failed to delete. args: %q: %v", rr.Command(), err) + } + }) + } func TestDownloadOnlyKic(t *testing.T) { diff --git a/test/integration/aab_offline_test.go b/test/integration/aab_offline_test.go index d41e682f23..8943d1b634 100644 --- a/test/integration/aab_offline_test.go +++ b/test/integration/aab_offline_test.go @@ -26,43 +26,34 @@ import ( "testing" ) -// TestOffline makes sure minikube works without internet, once it the user has already cached the images, This test has to run after TestDownloadOnly! +// TestOffline makes sure minikube works without internet, once it the user has already cached the images, This test has to run after TestDownloadOnly func TestOffline(t *testing.T) { - t.Run("group", func(t *testing.T) { - for _, rt := range []string{"docker", "crio", "containerd"} { - 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()) - } + MaybeParallel(t) + rt := ContainerRuntime() + if rt != "docker" && arm64Platform() { + t.Skipf("skipping %s - only docker runtime supported on arm64. See https://github.com/kubernetes/minikube/issues/10144", t.Name()) + } - if rt != "docker" && NoneDriver() { - t.Skipf("skipping %s - incompatible with none driver", t.Name()) - } + if rt != "docker" && NoneDriver() { + t.Skipf("skipping %s - incompatible with none driver", t.Name()) + } - profile := UniqueProfileName(fmt.Sprintf("offline-%s", rt)) - ctx, cancel := context.WithTimeout(context.Background(), Minutes(15)) - defer CleanupWithLogs(t, profile, cancel) + profile := UniqueProfileName(fmt.Sprintf("offline-%s", rt)) + ctx, cancel := context.WithTimeout(context.Background(), Minutes(15)) + defer CleanupWithLogs(t, profile, cancel) - startArgs := []string{"start", "-p", profile, "--alsologtostderr", "-v=1", "--memory=2000", "--wait=true", "--container-runtime", rt} - startArgs = append(startArgs, StartArgs()...) - c := exec.CommandContext(ctx, Target(), startArgs...) - env := os.Environ() - // RFC1918 address that unlikely to host working a proxy server - env = append(env, "HTTP_PROXY=172.16.1.1:1") - env = append(env, "HTTP_PROXYS=172.16.1.1:1") + startArgs := []string{"start", "-p", profile, "--alsologtostderr", "-v=1", "--memory=2000", "--wait=true"} + startArgs = append(startArgs, StartArgs()...) + c := exec.CommandContext(ctx, Target(), startArgs...) + env := os.Environ() + // RFC1918 address that unlikely to host working a proxy server + env = append(env, "HTTP_PROXY=172.16.1.1:1") + env = append(env, "HTTP_PROXYS=172.16.1.1:1") - c.Env = env - rr, err := Run(t, c) - if err != nil { - // Fatal so that we may collect logs before stop/delete steps - t.Fatalf("%s failed: %v", rr.Command(), err) - } - }) - } - }) + c.Env = env + rr, err := Run(t, c) + if err != nil { + // Fatal so that we may collect logs before stop/delete steps + t.Fatalf("%s failed: %v", rr.Command(), err) + } } From e61a30f6b709cd9a6040f5039505305f913fae98 Mon Sep 17 00:00:00 2001 From: minikube-bot Date: Fri, 22 Jan 2021 13:33:58 -0800 Subject: [PATCH 07/21] Update releases.json to include v1.17.0 --- deploy/minikube/releases.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deploy/minikube/releases.json b/deploy/minikube/releases.json index 7e9b91c968..507578a583 100644 --- a/deploy/minikube/releases.json +++ b/deploy/minikube/releases.json @@ -1,4 +1,12 @@ [ + { + "name": "v1.17.0", + "checksums": { + "darwin": "ad2b4de4b3f8863c2cfa9f5072cdc787141b0587fb9855dd645242253489fab3", + "linux": "e312901e12c347d0e4eec74d94b8d75512943eb62479b441bb1332f05cde0d09", + "windows": "dcae6ee972a49c4389d5e3ea81039b826cda55fefbe23b9273eeb46514abe244" + } + }, { "name": "v1.16.0", "checksums": { From 35ba15b082cfbc1433268006fd26100990dd5d1a Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 14:13:33 -0800 Subject: [PATCH 08/21] Fix TestForceSystemdFlag on containerd --- test/integration/docker_test.go | 38 ++++++++++++++++++++++++--------- test/integration/main_test.go | 11 ++++++++++ 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/test/integration/docker_test.go b/test/integration/docker_test.go index 27e6a57263..8fa9c9b9a6 100644 --- a/test/integration/docker_test.go +++ b/test/integration/docker_test.go @@ -82,16 +82,36 @@ func TestForceSystemdFlag(t *testing.T) { t.Errorf("failed to start minikube with args: %q : %v", rr.Command(), err) } - rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "docker info --format {{.CgroupDriver}}")) + containerRuntime := ContainerRuntime() + switch containerRuntime { + case "docker": + validateDockerSystemd(t, ctx, profile) + case "containerd": + validateContainerdSystemd(t, ctx, profile) + } + +} + +func validateDockerSystemd(t *testing.T, ctx context.Context, profile string) { + rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "docker info --format {{.CgroupDriver}}")) if err != nil { t.Errorf("failed to get docker cgroup driver. args %q: %v", rr.Command(), err) } - if !strings.Contains(rr.Output(), "systemd") { t.Fatalf("expected systemd cgroup driver, got: %v", rr.Output()) } } +func validateContainerdSystemd(t *testing.T, ctx context.Context, profile string) { + rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "cat /etc/containerd/config.toml")) + if err != nil { + t.Errorf("failed to get docker cgroup driver. args %q: %v", rr.Command(), err) + } + if !strings.Contains(rr.Output(), "systemd_cgroup = true") { + t.Fatalf("expected systemd cgroup driver, got: %v", rr.Output()) + } +} + func TestForceSystemdEnv(t *testing.T) { if NoneDriver() { t.Skip("skipping: none driver does not support ssh or bundle docker") @@ -109,13 +129,11 @@ func TestForceSystemdEnv(t *testing.T) { if err != nil { t.Errorf("failed to start minikube with args: %q : %v", rr.Command(), err) } - - rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "docker info --format {{.CgroupDriver}}")) - if err != nil { - t.Errorf("failed to get docker cgroup driver. args %q: %v", rr.Command(), err) - } - - if !strings.Contains(rr.Output(), "systemd") { - t.Fatalf("expected systemd cgroup driver, got: %v", rr.Output()) + containerRuntime := ContainerRuntime() + switch containerRuntime { + case "docker": + validateDockerSystemd(t, ctx, profile) + case "containerd": + validateContainerdSystemd(t, ctx, profile) } } diff --git a/test/integration/main_test.go b/test/integration/main_test.go index d6dfda30b2..91bcd0f04a 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -129,6 +129,17 @@ func KicDriver() bool { return DockerDriver() || PodmanDriver() } +// ContainerRuntime returns the name of a specific container runtime if it was specified +func ContainerRuntime() string { + flag := "--container-runtime=" + for _, s := range StartArgs() { + if strings.HasPrefix(s, flag) { + return strings.TrimPrefix(s, flag) + } + } + return "docker" +} + // GithubActionRunner returns true if running inside a github action runner func GithubActionRunner() bool { // based on https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables From ebf76d5839598cd5b53cb5d971f0d0d05ccb4255 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 14:26:12 -0800 Subject: [PATCH 09/21] Revert --- 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 df93c7ca2b74c25848ef78cc1d05f3b1e1225f23 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 14:29:41 -0800 Subject: [PATCH 10/21] fix function --- test/integration/main_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/integration/main_test.go b/test/integration/main_test.go index cb1b7bb420..e15943c2c6 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -127,15 +127,12 @@ func PodmanDriver() bool { // 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 "" + return "docker" } // KicDriver returns whether or not this test is using the docker or podman driver From 1c26fc0e27207d19e2cb16934374e0e66182acc7 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 14:51:57 -0800 Subject: [PATCH 11/21] Fix lint --- test/integration/docker_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/docker_test.go b/test/integration/docker_test.go index 8fa9c9b9a6..d99fc63406 100644 --- a/test/integration/docker_test.go +++ b/test/integration/docker_test.go @@ -85,14 +85,14 @@ func TestForceSystemdFlag(t *testing.T) { containerRuntime := ContainerRuntime() switch containerRuntime { case "docker": - validateDockerSystemd(t, ctx, profile) + validateDockerSystemd(ctx, t, profile) case "containerd": - validateContainerdSystemd(t, ctx, profile) + validateContainerdSystemd(ctx, t, profile) } } -func validateDockerSystemd(t *testing.T, ctx context.Context, profile string) { +func validateDockerSystemd(ctx context.Context, t *testing.T, profile string) { rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "docker info --format {{.CgroupDriver}}")) if err != nil { t.Errorf("failed to get docker cgroup driver. args %q: %v", rr.Command(), err) @@ -102,7 +102,7 @@ func validateDockerSystemd(t *testing.T, ctx context.Context, profile string) { } } -func validateContainerdSystemd(t *testing.T, ctx context.Context, profile string) { +func validateContainerdSystemd(ctx context.Context, t *testing.T, profile string) { rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "cat /etc/containerd/config.toml")) if err != nil { t.Errorf("failed to get docker cgroup driver. args %q: %v", rr.Command(), err) @@ -132,8 +132,8 @@ func TestForceSystemdEnv(t *testing.T) { containerRuntime := ContainerRuntime() switch containerRuntime { case "docker": - validateDockerSystemd(t, ctx, profile) + validateDockerSystemd(ctx, t, profile) case "containerd": - validateContainerdSystemd(t, ctx, profile) + validateContainerdSystemd(ctx, t, profile) } } From edee1223e27491fc4e5fdd6f0df0c8fe7cf5ebdc Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 14:55:00 -0800 Subject: [PATCH 12/21] fix merge conflict --- test/integration/main_test.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 42c3097556..d1a129790d 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -125,17 +125,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=" - for _, s := range StartArgs() { - if strings.HasPrefix(s, flag) { - return strings.TrimPrefix(s, flag) - } - } - return "docker" -} - // KicDriver returns whether or not this test is using the docker or podman driver func KicDriver() bool { return DockerDriver() || PodmanDriver() From aeb45368d7a90fdcb93a168b12b4e237db2cea58 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 15:00:28 -0800 Subject: [PATCH 13/21] Only run TestDockerFlags with docker container runtime This test is failing for contaienrd tests, but it doesn't make sense to run it with anything but docker. Adding in a skip. --- test/integration/docker_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/docker_test.go b/test/integration/docker_test.go index 27e6a57263..2170d4f712 100644 --- a/test/integration/docker_test.go +++ b/test/integration/docker_test.go @@ -30,6 +30,9 @@ func TestDockerFlags(t *testing.T) { if NoneDriver() { t.Skip("skipping: none driver does not support ssh or bundle docker") } + if ContainerRuntime() != "docker" { + t.Skipf("skipping: only runs with docker container runtime, currently testing %s", ContainerRuntime()) + } MaybeParallel(t) profile := UniqueProfileName("docker-flags") From 62479fb16a6638d80c2deb4b2d8d1208a5661ade Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 15:03:18 -0800 Subject: [PATCH 14/21] only run TestFunctional/DockerEnv with docker container runtime --- test/integration/functional_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 09e99f7fb4..b80dbb08c6 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -160,6 +160,9 @@ func validateNodeLabels(ctx context.Context, t *testing.T, profile string) { // check functionality of minikube after evaling docker-env func validateDockerEnv(ctx context.Context, t *testing.T, profile string) { + if cr := ContainerRuntime(); cr != "docker" { + t.Skipf("only validate docker env with docker container runtime, currently testing %s", cr) + } defer PostMortemLogs(t, profile) mctx, cancel := context.WithTimeout(ctx, Seconds(120)) defer cancel() From cc4d2d450e053bea39cc30dbfb1dbfb38b580fd5 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 15:05:06 -0800 Subject: [PATCH 15/21] Also skip skaffold test because it also requires docker-env --- test/integration/skaffold_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/skaffold_test.go b/test/integration/skaffold_test.go index d1d1a4a93b..7695f9dc77 100644 --- a/test/integration/skaffold_test.go +++ b/test/integration/skaffold_test.go @@ -38,6 +38,9 @@ func TestSkaffold(t *testing.T) { if NoneDriver() { t.Skip("none driver doesn't support `minikube docker-env`; skaffold depends on this command") } + if cr := ContainerRuntime(); cr != "docker" { + t.Skipf("skaffold requires docker-env, currently testing %s container runtime", cr) + } profile := UniqueProfileName("skaffold") ctx, cancel := context.WithTimeout(context.Background(), Minutes(5)) From 9cdb76fcc820dca6eb863a3d2461de6c3f68a569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Str=C3=B6mberg?= Date: Fri, 22 Jan 2021 15:18:17 -0800 Subject: [PATCH 16/21] Make rpm-version behave the same as deb-version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 76d5cb1d1d..4e246b6b79 100644 --- a/Makefile +++ b/Makefile @@ -485,7 +485,7 @@ out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_%.deb: out/minikube-linux-% rm -rf out/minikube_$(DEB_VERSION) rpm_version: - @echo $(RPM_VERSION) + @echo $(RPM_VERSION)-$(RPM_REVISION) out/minikube-$(RPM_VERSION).rpm: out/minikube-$(RPM_VERSION)-$(RPM_REVISION).x86_64.rpm cp $< $@ From 9bd1528dbe3a849cecfa0e9363254b74dbc2a547 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 22 Jan 2021 15:56:21 -0800 Subject: [PATCH 17/21] Add TODO --- test/integration/functional_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index b80dbb08c6..425de6f2a2 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -159,6 +159,7 @@ func validateNodeLabels(ctx context.Context, t *testing.T, profile string) { } // check functionality of minikube after evaling docker-env +// TODO: Add validatePodmanEnv for crio runtime: #10231 func validateDockerEnv(ctx context.Context, t *testing.T, profile string) { if cr := ContainerRuntime(); cr != "docker" { t.Skipf("only validate docker env with docker container runtime, currently testing %s", cr) From ba32668192eba2994bcc4a11f6d0c18bbfca8bb2 Mon Sep 17 00:00:00 2001 From: BLasan Date: Mon, 25 Jan 2021 02:49:11 +0530 Subject: [PATCH 18/21] Add resource requests & limits for mysql test --- test/integration/testdata/mysql.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/integration/testdata/mysql.yaml b/test/integration/testdata/mysql.yaml index fd90187228..986430cc76 100644 --- a/test/integration/testdata/mysql.yaml +++ b/test/integration/testdata/mysql.yaml @@ -24,8 +24,15 @@ spec: app: mysql spec: containers: - - image: mysql:5.6 + - image: mysql:5.7 name: mysql + resources: + requests: + memory: "512Mi" + cpu: "600m" + limits: + memory: "700Mi" + cpu: "700m" env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD From 8175e648109e308bfe42f7304e27783a6cf71b9d Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 25 Jan 2021 09:50:29 -0800 Subject: [PATCH 19/21] Set DEB_REVISION=2, since we manually had to upload new .deb files due to #10224 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 09c8bd0dd4..4d137b5836 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f ISO_VERSION ?= v1.17.0 # Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta DEB_VERSION ?= $(subst -,~,$(RAW_VERSION)) -DEB_REVISION ?= 0 +DEB_REVISION ?= 2 RPM_VERSION ?= $(DEB_VERSION) RPM_REVISION ?= 0 From 647aa96458c273763388e716a3173782a54ee968 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 25 Jan 2021 09:52:24 -0800 Subject: [PATCH 20/21] Add updating revision info to docs --- site/content/en/docs/contrib/releasing/binaries.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/site/content/en/docs/contrib/releasing/binaries.md b/site/content/en/docs/contrib/releasing/binaries.md index 4b3fa0a4a4..c1c22057c3 100644 --- a/site/content/en/docs/contrib/releasing/binaries.md +++ b/site/content/en/docs/contrib/releasing/binaries.md @@ -55,6 +55,9 @@ Update the version numbers in `Makefile`: - beta releases use: `v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)` - major/minor releases use: `v$(VERSION_MAJOR).$(VERSION_MINOR).0` - if the ISO was updated, a patch release may use `v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)` +* `DEB_REVISION`, `RPM_REVISION` + - for all major/minor releases, set to 0 + - if updating .deb files without a major/minor release, increment by 1 {{% alert title="Warning" color="warning" %}} Merge this PR only if all non-experimental integration tests pass! From 9f1c3b5f7f6fbe1ca761f6370ee730e0ae7008ad Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 25 Jan 2021 10:16:20 -0800 Subject: [PATCH 21/21] update docZ --- site/content/en/docs/contrib/releasing/binaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/en/docs/contrib/releasing/binaries.md b/site/content/en/docs/contrib/releasing/binaries.md index c1c22057c3..83ab003011 100644 --- a/site/content/en/docs/contrib/releasing/binaries.md +++ b/site/content/en/docs/contrib/releasing/binaries.md @@ -57,7 +57,7 @@ Update the version numbers in `Makefile`: - if the ISO was updated, a patch release may use `v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)` * `DEB_REVISION`, `RPM_REVISION` - for all major/minor releases, set to 0 - - if updating .deb files without a major/minor release, increment by 1 + - if updating .deb/.rpm files without a major/minor release, increment by 1 {{% alert title="Warning" color="warning" %}} Merge this PR only if all non-experimental integration tests pass!