Skip to content

Commit

Permalink
fix: update supported kube-version for gardener and k3d (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobebway authored Mar 7, 2024
1 parent 88ac0e9 commit 4e38d6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions hack/ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ PROJECT_ROOT ?= ../..
KYMA_CLI ?= "${PROJECT_ROOT}/${KYMA}"
CLUSTER_NAME ?= kyma
REGISTRY_PORT ?= 5001
K3D_VERSION ?= 1.28.7
K3D_VERSION ?= 1.28.4
GARDENER_KUBE_VERSION ?= 1.28.4

.PHONY: create-kyma-system-ns
create-kyma-system-ns: ## Create kyma-system namespace.
kubectl create ns kyma-system

.PHONY: create-k3d
create-k3d: ## Create k3d with kyma CRDs.
"${KYMA_CLI}" provision k3d -p 8081:80@loadbalancer -p 8443:443@loadbalancer --registry-port ${REGISTRY_PORT} --name ${CLUSTER_NAME} -k ${K3D_VERSION} --ci
"${KYMA_CLI}" provision k3d -p 8081:80@loadbalancer -p 8443:443@loadbalancer --registry-port ${REGISTRY_PORT} --name ${CLUSTER_NAME} -k ${K3D_VERSION} --ci

.PHONY: install-nats-module
install-nats-module:
Expand Down Expand Up @@ -68,7 +69,7 @@ wait-api-gateway-cr-ready:

.PHONY: provision-gardener-cluster
provision-gardener-cluster:
GARDENER_CLUSTER_VERSION="${K3D_VERSION}" PROJECT_ROOT="${PROJECT_ROOT}" KYMA_CLI="${KYMA_CLI}" ${PROJECT_ROOT}/scripts/gardener/aws/provision.sh
GARDENER_CLUSTER_VERSION="${GARDENER_KUBE_VERSION}" PROJECT_ROOT="${PROJECT_ROOT}" KYMA_CLI="${KYMA_CLI}" ${PROJECT_ROOT}/scripts/gardener/aws/provision.sh

.PHONY: deprovision-gardener-cluster
deprovision-gardener-cluster:
Expand Down
6 changes: 3 additions & 3 deletions scripts/gardener/aws/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ gardener::validate_and_default() {
fi

if [ -z "$GARDENER_CLUSTER_VERSION" ]; then
# grep the default kube-version defined in kyma CLI.
export GARDENER_CLUSTER_VERSION="$(${KYMA_CLI} provision gardener aws --help | grep "kube-version string" | awk -F "\"" '{print $2}')"
# Detect supported kube-version.
export GARDENER_CLUSTER_VERSION=$(kubectl --kubeconfig="${GARDENER_KUBECONFIG}" get cloudprofiles.core.gardener.cloud aws -o go-template='{{range .spec.kubernetes.versions}}{{if eq .classification "supported"}}{{.version}}{{break}}{{end}}{{end}}')
fi

# Detect supported linux version.
GARDEN_LINUX_VERSION=$(kubectl --kubeconfig="${GARDENER_KUBECONFIG}" get cloudprofiles.core.gardener.cloud gcp -o go-template='{{range .spec.machineImages}}{{if eq .name "gardenlinux"}}{{range .versions}}{{if eq .classification "supported"}}{{.version}}{{end}}{{end}}{{end}}{{end}}')
GARDEN_LINUX_VERSION=$(kubectl --kubeconfig="${GARDENER_KUBECONFIG}" get cloudprofiles.core.gardener.cloud aws -o go-template='{{range .spec.machineImages}}{{if eq .name "gardenlinux"}}{{range .versions}}{{if eq .classification "supported"}}{{.version}}{{end}}{{end}}{{end}}{{end}}')

# print configurations for debugging purposes:
log::banner "Configurations:"
Expand Down

0 comments on commit 4e38d6e

Please sign in to comment.