From e6ea24013a348c91ab8c585ad5755a493b19eb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serta=C3=A7=20=C3=96zercan?= <852750+sozercan@users.noreply.github.com> Date: Fri, 21 May 2021 22:33:48 -0700 Subject: [PATCH] add k8s v1.21 to test matrix (#1314) --- .github/workflows/workflow.yaml | 8 ++++---- Makefile | 10 +++++----- test/bats/test.bats | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 0fbe00021b6..a12c1ce3aa8 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -93,7 +93,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - KUBERNETES_VERSION: ["v1.19.7", "v1.20.2"] + KUBERNETES_VERSION: ["1.19.11", "1.20.7", "1.21.1"] steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 @@ -107,7 +107,7 @@ jobs: run: | mkdir -p $GITHUB_WORKSPACE/bin echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH - make e2e-bootstrap + make e2e-bootstrap KUBERNETES_VERSION=${{ matrix.KUBERNETES_VERSION }} - name: Run e2e run: | @@ -173,7 +173,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - KUBERNETES_VERSION: ["v1.19.7", "v1.20.2"] + KUBERNETES_VERSION: ["1.19.11", "1.20.7", "1.21.1"] steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 @@ -187,7 +187,7 @@ jobs: run: | mkdir -p $GITHUB_WORKSPACE/bin echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH - make e2e-bootstrap + make e2e-bootstrap KUBERNETES_VERSION=${{ matrix.KUBERNETES_VERSION }} - name: Run e2e mutation run: | diff --git a/Makefile b/Makefile index 939f98090e7..703dfa8ceeb 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,9 @@ USE_LOCAL_IMG ?= false VERSION := v3.4.0 -KIND_VERSION ?= 0.10.0 +KIND_VERSION ?= 0.11.0 # note: k8s version pinned since KIND image availability lags k8s releases -KUBERNETES_VERSION ?= v1.20.2 +KUBERNETES_VERSION ?= 1.21.1 KUSTOMIZE_VERSION ?= 3.8.8 BATS_VERSION ?= 1.2.1 BATS_TESTS_FILE ?= test/bats/test.bats @@ -97,15 +97,15 @@ e2e-bootstrap: # Download and install kind curl -L https://github.com/kubernetes-sigs/kind/releases/download/v${KIND_VERSION}/kind-linux-amd64 --output ${GITHUB_WORKSPACE}/bin/kind && chmod +x ${GITHUB_WORKSPACE}/bin/kind # Download and install kubectl - curl -L https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl -o ${GITHUB_WORKSPACE}/bin/kubectl && chmod +x ${GITHUB_WORKSPACE}/bin/kubectl + curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl -o ${GITHUB_WORKSPACE}/bin/kubectl && chmod +x ${GITHUB_WORKSPACE}/bin/kubectl # Download and install kustomize curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz -o kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && tar -zxvf kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && chmod +x kustomize && mv kustomize ${GITHUB_WORKSPACE}/bin/kustomize # Download and install bats curl -sSLO https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz && tar -zxvf v${BATS_VERSION}.tar.gz && bash bats-core-${BATS_VERSION}/install.sh ${GITHUB_WORKSPACE} # Check for existing kind cluster - if [ $$(kind get clusters) ]; then kind delete cluster; fi + if [ $$(${GITHUB_WORKSPACE}/bin/kind get clusters) ]; then ${GITHUB_WORKSPACE}/bin/kind delete cluster; fi # Create a new kind cluster - TERM=dumb kind create cluster --image kindest/node:${KUBERNETES_VERSION} --wait 5m + TERM=dumb ${GITHUB_WORKSPACE}/bin/kind create cluster --image kindest/node:v${KUBERNETES_VERSION} --wait 5m e2e-build-load-image: docker-buildx kind load docker-image --name kind ${IMG} diff --git a/test/bats/test.bats b/test/bats/test.bats index 7cbfa3cb7ca..ee7e43ba979 100644 --- a/test/bats/test.bats +++ b/test/bats/test.bats @@ -33,11 +33,11 @@ teardown_file() { CLEAN_CMD="${CLEAN_CMD}; rm ${cert}" wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "get_ca_cert ${cert}" - kubectl run --generator=run-pod/v1 temp --image=ecabuk/curl-cacert -- tail -f /dev/null + kubectl run temp --image=curlimages/curl -- tail -f /dev/null kubectl wait --for=condition=Ready --timeout=60s pod temp - kubectl cp ${cert} temp:/cacert + kubectl cp ${cert} temp:/tmp/cacert - wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl exec -it temp -- curl -f --cacert /cacert --connect-timeout 1 --max-time 2 https://gatekeeper-webhook-service.${GATEKEEPER_NAMESPACE}.svc:443/v1/admitlabel" + wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl exec -it temp -- curl -f --cacert /tmp/cacert --connect-timeout 1 --max-time 2 https://gatekeeper-webhook-service.${GATEKEEPER_NAMESPACE}.svc:443/v1/admitlabel" kubectl delete pod temp } @@ -149,7 +149,7 @@ teardown_file() { } @test "waiting for namespaces to be synced using metrics endpoint" { - kubectl run --generator=run-pod/v1 temp --image=ecabuk/curl-cacert -- tail -f /dev/null + kubectl run temp --image=curlimages/curl -- tail -f /dev/null kubectl wait --for=condition=Ready --timeout=60s pod temp num_namespaces=$(kubectl get ns -o json | jq '.items | length')