Skip to content

Commit

Permalink
chore: Test compatibility with next k8s version 1.28 (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-thaler authored Feb 6, 2024
1 parent 26e4631 commit 0c402ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/branch-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:

jobs:
gardener-integration-test:
strategy:
matrix:
k8s_version: [1.27, 1.28]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand All @@ -33,6 +36,7 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_OWNER: "${{ github.repository_owner }}"
GITHUB_REPO: "telemetry-manager"
GARDENER_K8S_VERSION: ${{ matrix.k8s_version }}

# save gardener kubeconfig to a temp file in order to pass it to the command
- name: Save serviceaccount to file
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Image URL to use all building/pushing image targets
IMG ?= europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:main
# ENVTEST_K8S_VERSION refers to the version of Kubebuilder assets to be downloaded by envtest binary.

ENVTEST_K8S_VERSION = 1.27.1
GARDENER_K8S_VERSION ?= 1.27
ISTIO_VERSION ?= 1.3.0

# Operating system architecture
OS_ARCH ?= $(shell uname -m)
# Operating system type
Expand Down Expand Up @@ -369,8 +372,10 @@ $(KYMA):
GIT_COMMIT_SHA=$(shell git rev-parse --short=8 HEAD)
GIT_COMMIT_DATE=$(shell git show -s --format=%cd --date=format:'v%Y%m%d' ${GIT_COMMIT_SHA})
HIBERNATION_HOUR=$(shell echo $$(( ( $(shell date +%H | sed s/^0//g) + 5 ) % 24 )))
GARDENER_CLUSTER_NAME=$(shell echo "test-${GIT_COMMIT_SHA}-${GARDENER_K8S_VERSION}" | sed 's/\.//g')

ifneq (,$(GARDENER_SA_PATH))
GARDENER_K8S_VERSION?=$(shell kubectl --kubeconfig=${GARDENER_SA_PATH} get cloudprofiles.core.gardener.cloud gcp -o=jsonpath='{.spec.kubernetes.versions[0].version}')
GARDENER_K8S_VERSION_FULL=$(shell kubectl --kubeconfig=${GARDENER_SA_PATH} get cloudprofiles.core.gardener.cloud gcp -o go-template='{{range .spec.kubernetes.versions}}{{if and (eq .classification "supported") (lt .version "${GARDENER_K8S_VERSION}.a") (gt .version "${GARDENER_K8S_VERSION}")}}{{.version}}{{end}}{{end}}')
endif

# log tests are excluded for now as they are too flaky
Expand All @@ -389,10 +394,10 @@ gardener-integration-test: ## Provision gardener cluster and run integration tes

.PHONY: provision-gardener
provision-gardener: kyma ## Provision gardener cluster with latest k8s version
${KYMA} provision gardener gcp -c ${GARDENER_SA_PATH} -n test-${GIT_COMMIT_SHA} -p ${GARDENER_PROJECT} -s ${GARDENER_SECRET_NAME} -k ${GARDENER_K8S_VERSION}\
${KYMA} provision gardener gcp -c ${GARDENER_SA_PATH} -n ${GARDENER_CLUSTER_NAME} -p ${GARDENER_PROJECT} -s ${GARDENER_SECRET_NAME} -k ${GARDENER_K8S_VERSION_FULL}\
--hibernation-start="00 ${HIBERNATION_HOUR} * * ?"

.PHONY: deprovision-gardener
deprovision-gardener: kyma ## Deprovision gardener cluster
kubectl --kubeconfig=${GARDENER_SA_PATH} annotate shoot test-${GIT_COMMIT_SHA} confirmation.gardener.cloud/deletion=true
kubectl --kubeconfig=${GARDENER_SA_PATH} delete shoot test-${GIT_COMMIT_SHA} --wait=false
kubectl --kubeconfig=${GARDENER_SA_PATH} annotate shoot ${GARDENER_CLUSTER_NAME} confirmation.gardener.cloud/deletion=true
kubectl --kubeconfig=${GARDENER_SA_PATH} delete shoot ${GARDENER_CLUSTER_NAME} --wait=false

0 comments on commit 0c402ff

Please sign in to comment.