From 78e328259db13bb00a2ef7d0c9f089c9104b21b5 Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Fri, 6 Mar 2020 11:37:47 +0000 Subject: [PATCH] Use legacy CRD manifests when running end-to-end tests against Kubernetes 1.14 and below Signed-off-by: James Munnelly --- devel/addon/certmanager/install.sh | 8 +++++++- devel/cluster/create.sh | 4 ---- devel/lib/lib.sh | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/devel/addon/certmanager/install.sh b/devel/addon/certmanager/install.sh index 5b08cb05e..3b0cf1f5b 100755 --- a/devel/addon/certmanager/install.sh +++ b/devel/addon/certmanager/install.sh @@ -48,8 +48,14 @@ wait # Ensure the pebble namespace exists kubectl get namespace "${NAMESPACE}" || kubectl create namespace "${NAMESPACE}" +crdsmanifest="cert-manager.crds.yaml" +if [[ "$K8S_VERSION" =~ 1\.1[1-4] ]]; then + crdsmanifest="cert-manager-legacy.crds.yaml" +fi +bazel build "//deploy/manifests:$crdsmanifest" + # Install a copy of the CRDs -kubectl apply -f "${REPO_ROOT}/deploy/charts/cert-manager/crds/" +kubectl apply -f "${REPO_ROOT}/bazel-bin/deploy/manifests/$crdsmanifest" # Upgrade or install Pebble helm upgrade \ diff --git a/devel/cluster/create.sh b/devel/cluster/create.sh index f1ee24031..e6a61fa70 100755 --- a/devel/cluster/create.sh +++ b/devel/cluster/create.sh @@ -25,10 +25,6 @@ SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") # Require helm available on PATH check_tool kind -export KIND_IMAGE_REPO="kindest/node" -# Default Kubernetes version to use to 1.17 -export K8S_VERSION=${K8S_VERSION:-1.17} - # Compute the details of the kind image to use export KIND_IMAGE_SHA="" export KIND_IMAGE_CONFIG="" diff --git a/devel/lib/lib.sh b/devel/lib/lib.sh index f0bc897be..1cc7fb317 100644 --- a/devel/lib/lib.sh +++ b/devel/lib/lib.sh @@ -23,6 +23,9 @@ export REPO_ROOT="$LIB_ROOT/../.." export SKIP_BUILD_ADDON_IMAGES="${SKIP_BUILD_ADDON_IMAGES:-}" export KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-kind}" +export KIND_IMAGE_REPO="kindest/node" +# Default Kubernetes version to use to 1.17 +export K8S_VERSION=${K8S_VERSION:-1.17} # setup_tools will build and set up the environment to use bazel-provided # versions of the tools required for development