Skip to content

Commit c4c18d9

Browse files
authored
Merge pull request #856 from oz123/test-suite-change-k8s-version
Don't use latest stable version for minikube
2 parents c86e489 + d7300db commit c4c18d9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scripts/kube-init.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,20 @@ else
4444
fi
4545
docker --version
4646

47-
# Get the latest stable version of kubernetes
47+
# Get the latest stable version of kubernetes, this is not always what minikube
48+
# installs per default
49+
# See:
50+
# https://github.com/kubernetes/minikube/blob/master/pkg/minikube/constants/constants.go
4851
K8S_VERSION=$(curl -sS https://storage.googleapis.com/kubernetes-release/release/stable.txt)
4952
echo "K8S_VERSION : ${K8S_VERSION}"
5053

54+
# You can pass variables to minikube using MINIKUBE_ARGS
55+
# If using tox you can export TOX_TESTENV_PASSENV.
56+
# For example, you can run:
57+
# $ export TOX_TESTENV_PASSENV="MINIKUBE_ARGS=--kubernetes-version=1.X.Y"
58+
# now tox will run minikube with the specified flag
59+
MINIKUBE_ARGS=${MINIKUBE_ARGS:-""}
60+
5161
echo "Starting docker service"
5262
sudo systemctl enable docker.service
5363
sudo systemctl start docker.service --ignore-dependencies
@@ -80,7 +90,7 @@ export MINIKUBE_DRIVER=${MINIKUBE_DRIVER:-none}
8090
# Used bootstrapper to be kubeadm for the most recent k8s version
8191
# since localkube is depreciated and only supported up to version 1.10.0
8292
echo "Starting minikube"
83-
sudo minikube start --vm-driver=$MINIKUBE_DRIVER --bootstrapper=kubeadm --kubernetes-version=$K8S_VERSION --logtostderr
93+
sudo minikube start --vm-driver=$MINIKUBE_DRIVER --bootstrapper=kubeadm --logtostderr $MINIKUBE_ARGS
8494

8595
MINIKUBE_OK="false"
8696

0 commit comments

Comments
 (0)