diff --git a/components/operator/hack/ci/Makefile b/components/operator/hack/ci/Makefile index 9609a3249..8d7c234f0 100644 --- a/components/operator/hack/ci/Makefile +++ b/components/operator/hack/ci/Makefile @@ -52,13 +52,25 @@ install-latest-serverless: kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/default-serverless-cr.yaml -n kyma-system @make -C ${PROJECT_COMMON} verify-serverless +##@ Gardener + +HIBERNATION_HOUR=$(shell echo $$(( ( $(shell date +%H | sed s/^0//g) + 5 ) % 24 ))) +GIT_COMMIT_SHA=$(shell git rev-parse --short=8 HEAD) +ifneq (,$(GARDENER_SA_PATH)) +GARDENER_K8S_VERSION=$(shell kubectl --kubeconfig=${GARDENER_SA_PATH} get cloudprofiles.core.gardener.cloud ${GARDENER_INFRASTRUCTURE} -o=jsonpath='{.spec.kubernetes.versions[0].version}') +else +GARDENER_K8S_VERSION=1.27.4 +endif + .PHONY: provision-gardener -provision-gardener: - @make -C ${PROJECT_COMMON} provision-gardener +provision-gardener: kyma ## Provision gardener cluster with latest k8s version + ${KYMA} provision gardener ${GARDENER_INFRASTRUCTURE} -c ${GARDENER_SA_PATH} -n test-${GIT_COMMIT_SHA} -p ${GARDENER_PROJECT} -s ${GARDENER_SECRET_NAME} -k ${GARDENER_K8S_VERSION}\ + --hibernation-start="00 ${HIBERNATION_HOUR} * * ?" .PHONY: deprovision-gardener -deprovision-gardener: - @make -C ${PROJECT_COMMON} 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 .PHONY: run run: diff --git a/components/operator/hack/common/Makefile b/components/operator/hack/common/Makefile index f84c38f71..ca3400a75 100644 --- a/components/operator/hack/common/Makefile +++ b/components/operator/hack/common/Makefile @@ -52,28 +52,9 @@ delete-k3d-registry: ## Delete k3d kyma registry. delete-k3d-cluster: ## Delete k3d kyma cluster. -k3d cluster delete ${CLUSTER_NAME} -##@ Gardener - -HIBERNATION_HOUR=$(shell echo $$(( ( $(shell date +%H | sed s/^0//g) + 5 ) % 24 ))) -GIT_COMMIT_SHA=$(shell git rev-parse --short=8 HEAD) -ifneq (,$(GARDENER_SA_PATH)) -GARDENER_K8S_VERSION=$(shell kubectl --kubeconfig=${GARDENER_SA_PATH} get cloudprofiles.core.gardener.cloud ${GARDENER_INFRASTRUCTURE} -o=jsonpath='{.spec.kubernetes.versions[0].version}') -else -GARDENER_K8S_VERSION=1.27.4 -endif - -.PHONY: provision-gardener -provision-gardener: kyma ## Provision gardener cluster with latest k8s version - ${KYMA} provision gardener ${GARDENER_INFRASTRUCTURE} -c ${GARDENER_SA_PATH} -n test-${GIT_COMMIT_SHA} -p ${GARDENER_PROJECT} -s ${GARDENER_SECRET_NAME} -k ${GARDENER_K8S_VERSION}\ - --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 - ##@ Module management +#TODO: rename it to check-serverless-instalation .PHONY: verify-serverless verify-serverless: ## Wait for Serverless CR to be in Ready state. # wait some time to make sure operator starts the reconciliation first