Files
kube-prometheus/tests/e2e/travis-e2e.sh
Paul Gier 6f9be95aa6 tests: update compatibility tests to use k8s v1.16.2
There is a bug in v1.16.1 and v1.16.0 which causes the API server to
panic when it encounters `x-kubernetes-int-or-string` in a CRD.
So we should test with v1.16.2 or higher instead.

https://github.com/kubernetes/kubernetes/issues/83778
2020-05-20 11:07:15 -05:00

43 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# exit immediately when a command fails
set -e
# only exit with zero if all commands of the pipeline exit successfully
set -o pipefail
# error on unset variables
set -u
# print each command before executing it
set -x
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x kubectl
curl -Lo kind https://github.com/kubernetes-sigs/kind/releases/download/v0.6.1/kind-linux-amd64
chmod +x kind
run_e2e_tests() {
cluster_version=$1
./kind create cluster --image=kindest/node:$cluster_version
export KUBECONFIG="$(./kind get kubeconfig-path)"
# create namespace, permissions, and CRDs
./kubectl create -f manifests/setup
# wait for CRD creation to complete
until ./kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
# create monitoring components
./kubectl create -f manifests/
make test-e2e
./kind delete cluster
}
cluster_compatible_versions=("v1.16.2" "v1.17.0")
for cluster_version in "${cluster_compatible_versions[@]}"
do
run_e2e_tests $cluster_version
done