diff --git a/hack/jenkins/installers/check_install_golang.sh b/hack/jenkins/installers/check_install_golang.sh index 9831a07908..51ffdb6073 100755 --- a/hack/jenkins/installers/check_install_golang.sh +++ b/hack/jenkins/installers/check_install_golang.sh @@ -52,10 +52,15 @@ function check_and_install_golang() { function install_golang() { echo "Installing golang version: $1 on $2" pushd /tmp >/dev/null + + INSTALLOS=linux + if [[ "$OSTYPE" == "darwin"* ]]; then + INSTALLOS=darwin + fi # using sudo because previously installed versions might have been installed by a different user. # as it was the case on jenkins VM. - sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.linux-amd64.tar.gz" && - sudo tar xfa go${1}.linux-amd64.tar.gz && + sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.${INSTALLOS}-amd64.tar.gz" && + sudo tar xfa go${1}.${INSTALLOS}-amd64.tar.gz && sudo rm -rf "${2}/go" && sudo mv go "${2}/" && sudo chown -R $(whoami): ${2}/go popd >/dev/null diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 1592293a6c..fabb30b059 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -38,6 +38,7 @@ import ( "github.com/google/go-cmp/cmp" + "k8s.io/minikube/pkg/drivers/kic/oci" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/localpath" "k8s.io/minikube/pkg/minikube/reason" @@ -508,7 +509,11 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) { t.Run("add_local", func(t *testing.T) { if GithubActionRunner() && runtime.GOOS == "darwin" { t.Skipf("skipping this test because Docker can not run in macos on github action free version. https://github.community/t/is-it-possible-to-install-and-configure-docker-on-macos-runner/16981") + } + _, err := exec.LookPath(oci.Docker) + if err != nil { + t.Skipf("docker is not installed, skipping local image test") } dname, err := ioutil.TempDir("", profile) @@ -525,7 +530,7 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) { img := "minikube-local-cache-test:" + profile _, err = Run(t, exec.CommandContext(ctx, "docker", "build", "-t", img, dname)) if err != nil { - t.Errorf("failed to build docker image: %v", err) + t.Skipf("failed to build docker image, skipping local test: %v", err) } rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "cache", "add", img))