Skip to content

Commit

Permalink
add k8s v1.21 to test matrix (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
sozercan committed May 22, 2021
1 parent edb29d0 commit e6ea240
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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: |
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions test/bats/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit e6ea240

Please sign in to comment.