Skip to content

Commit

Permalink
Merge pull request #2101 from r2d4/use-ci-localkube
Browse files Browse the repository at this point in the history
Explicitly use localkube bootstrapper and binary
  • Loading branch information
r2d4 committed Oct 31, 2017
2 parents 0175adf + 3fceab3 commit e68de40
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ test-pkg/%:
go test -v -test.timeout=30m $(REPOPATH)/$* --tags="$(MINIKUBE_BUILD_TAGS)"

.PHONY: all
all: cross drivers e2e-cross images
all: cross drivers e2e-cross images out/localkube

.PHONY: drivers
drivers: out/docker-machine-driver-hyperkit out/docker-machine-driver-kvm2
Expand Down Expand Up @@ -189,7 +189,7 @@ $(GOPATH)/bin/go-bindata:
GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...

.PHONY: cross
cross: out/localkube out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe
cross: out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe

.PHONY: e2e-cross
e2e-cross: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe
Expand Down
3 changes: 2 additions & 1 deletion hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# Copy only the files we need to this workspace
mkdir -p out/ testdata/
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH} out/
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/localkube out/
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH} out/
gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/busybox.yaml testdata/
Expand Down Expand Up @@ -83,7 +84,7 @@ find ~/.minikube || true

# Allow this to fail, we'll switch on the return code below.
set +e
${SUDO_PREFIX}out/e2e-${OS_ARCH} -minikube-start-args="--vm-driver=${VM_DRIVER}" -minikube-args="--v=10 --logtostderr ${EXTRA_ARGS}" -test.v -test.timeout=30m -binary=out/minikube-${OS_ARCH}
${SUDO_PREFIX}out/e2e-${OS_ARCH} -minikube-start-args="--vm-driver=${VM_DRIVER} ${EXTRA_START_ARGS}" -minikube-args="--v=10 --logtostderr ${EXTRA_ARGS}" -test.v -test.timeout=30m -binary=out/minikube-${OS_ARCH}
result=$?
set -e

Expand Down
3 changes: 2 additions & 1 deletion hack/jenkins/linux_integration_tests_kvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ set -e
OS_ARCH="linux-amd64"
VM_DRIVER="kvm"
JOB_NAME="Linux-KVM"

EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"

# Download files and set permissions
source common.sh
2 changes: 2 additions & 0 deletions hack/jenkins/linux_integration_tests_kvm_alt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set -e
OS_ARCH="linux-amd64"
VM_DRIVER="kvm2"
JOB_NAME="Linux-KVM-Alt"
EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"

# Download files and set permissions
source common.sh
4 changes: 3 additions & 1 deletion hack/jenkins/linux_integration_tests_none.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ set -e
OS_ARCH="linux-amd64"
VM_DRIVER="none"
JOB_NAME="Linux-None"
EXTRA_BUILD_ARGS="$EXTRA_BUILD_ARGS --use-vendored-driver"
EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"

SUDO_PREFIX="sudo -E "
export KUBECONFIG="/root/.kube/config"

Expand Down
2 changes: 2 additions & 0 deletions hack/jenkins/linux_integration_tests_virtualbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set -e
OS_ARCH="linux-amd64"
VM_DRIVER="virtualbox"
JOB_NAME="Linux-VirtualBox"
EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"

# Download files and set permissions
source common.sh
2 changes: 2 additions & 0 deletions hack/jenkins/osx_integration_tests_hyperkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set -e
OS_ARCH="darwin-amd64"
VM_DRIVER="hyperkit"
JOB_NAME="OSX-Hyperkit"
EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"


# Download files and set permissions
Expand Down
2 changes: 2 additions & 0 deletions hack/jenkins/osx_integration_tests_virtualbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set -e
OS_ARCH="darwin-amd64"
VM_DRIVER="virtualbox"
JOB_NAME="OSX-Virtualbox"
EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"

# Download files and set permissions
source common.sh
3 changes: 2 additions & 1 deletion hack/jenkins/osx_integration_tests_virtualbox_kubeadm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ set -e
OS_ARCH="darwin-amd64"
VM_DRIVER="virtualbox"
JOB_NAME="OSX-Virtualbox-Kubeadm"
EXTRA_ARGS="--bootstrapper=kubeadm"
EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"

# Download files and set permissions
source common.sh
2 changes: 2 additions & 0 deletions hack/jenkins/osx_integration_tests_xhyve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set -e
OS_ARCH="darwin-amd64"
VM_DRIVER="xhyve"
JOB_NAME="OSX-Xhyve"
EXTRA_ARGS="--bootstrapper=localkube"
EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube"


# Download files and set permissions
Expand Down
5 changes: 2 additions & 3 deletions hack/jenkins/windows_integration_test_virtualbox.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@

mkdir -p out
gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/
gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/localkube out/
gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/
gsutil.cmd cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata .


./out/minikube-windows-amd64.exe delete
Remove-Item -Recurse -Force C:\Users\jenkins\.minikube

out/e2e-windows-amd64.exe --% -minikube-start-args="--vm-driver=virtualbox" -minikube-args="--v=10 --logtostderr $env:EXTRA_BUILD_ARGS" -test.v -test.timeout=30m -binary=out/minikube-windows-amd64.exe

out/e2e-windows-amd64.exe -minikube-start-args="--vm-driver=virtualbox --kubernetes-version=https://storage.googleapis.com/minikube-builds/$env:MINIKUBE_LOCATION/localkube" -minikube-args="--v=10 --logtostderr" -binary=out/minikube-windows-amd64.exe -test.v -test.timeout=30m
$env:result=$lastexitcode
# If the last exit code was 0->success, x>0->error
If($env:result -eq 0){$env:status="success"}
Expand Down
4 changes: 4 additions & 0 deletions pkg/minikube/kubernetes_versions/kubernetes_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io"
"net/http"
"strings"

"k8s.io/minikube/pkg/minikube/constants"

Expand Down Expand Up @@ -80,6 +81,9 @@ func GetK8sVersionsFromURL(url string) (K8sReleases, error) {
}

func IsValidLocalkubeVersion(v string, url string) (bool, error) {
if strings.HasPrefix(v, "file://") || strings.HasPrefix(v, "http") {
return true, nil
}
k8sReleases, err := GetK8sVersionsFromURL(url)
glog.Infoln(k8sReleases)
if err != nil {
Expand Down

0 comments on commit e68de40

Please sign in to comment.