Skip to content

Commit

Permalink
Rename components/operator Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKalke committed Apr 9, 2024
1 parent a34beda commit f0401af
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ include ${PROJECT_ROOT}/hack/k3d.mk

##@ Installation
.PHONY: install-serverless-main
install-serverless-main: ## Install serverless with operator using default serverless cr
make -C ${OPERATOR_ROOT} deploy-main apply-default-serverless-cr check-serverless-installation
install-serverless-main: ## Install dockerregistry with operator using default dockerregistry cr
make -C ${OPERATOR_ROOT} deploy-main apply-default-dockerregistry-cr check-dockerregistry-installation

.PHONY: install-serverless-custom-operator
install-serverless-custom-operator: ## Install serverless with operator from IMG env using default serverless cr
install-serverless-custom-operator: ## Install dockerregistry with operator from IMG env using default dockerregistry cr
$(call check-var,IMG)
make -C ${OPERATOR_ROOT} deploy apply-default-serverless-cr check-serverless-installation
make -C ${OPERATOR_ROOT} deploy apply-default-dockerregistry-cr check-dockerregistry-installation

.PHONY: install-serverless-latest-release
install-serverless-latest-release: ## Install serverless from latest release
kubectl create namespace kyma-system || true
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/serverless-operator.yaml
kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/default-dockerregistry-cr.yaml -n kyma-system
make -C ${OPERATOR_ROOT} check-serverless-installation
make -C ${OPERATOR_ROOT} check-dockerregistry-installation

.PHONY: remove-serverless
remove-serverless: ## Remove serverless-cr and serverless operator
make -C ${OPERATOR_ROOT} remove-serverless undeploy
.PHONY: remove-dockerregistry
remove-dockerregistry: ## Remove dockerregistry-cr and serverless operator
make -C ${OPERATOR_ROOT} remove-dockerregistry undeploy

.PHONY: run
run: create-k3d install-serverless-main ## Create k3d cluster and install serverless from main
Expand Down
28 changes: 14 additions & 14 deletions components/operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ IGNORE_NOT_FOUND = false
OPERATOR_NAME = dockerregistry-operator

.PHONY: build-image-operator
build-image-operator: ## Build serverless operator from local sources on k3d
build-image-operator: ## Build dockerregistry operator from local sources on k3d
docker build -t $(OPERATOR_NAME) -f Dockerfile $(PROJECT_ROOT)

.PHONY: install-operator-k3d
install-operator-k3d: build-image-operator ## Build and install serverless operator from local sources on k3d
install-operator-k3d: build-image-operator ## Build and install dockerregistry operator from local sources on k3d
$(eval HASH_TAG=$(shell docker images $(OPERATOR_NAME):latest --quiet))
docker tag $(OPERATOR_NAME) $(OPERATOR_NAME):$(HASH_TAG)

Expand Down Expand Up @@ -112,30 +112,30 @@ render-manifest: manifests kustomize ## Render dockerregistry-operator.yaml mani
$(KUSTOMIZE) build $(CONFIG_OPERATOR) > $(PROJECT_ROOT)/dockerregistry-operator.yaml


.PHONY: apply-default-serverless-cr
apply-default-serverless-cr: ## Apply the k3d serverless CR.
.PHONY: apply-default-dockerregistry-cr
apply-default-dockerregistry-cr: ## Apply the k3d dockerregistry CR.
kubectl apply \
-f ${PROJECT_ROOT}/config/samples/default-dockerregistry-cr.yaml

.PHONY: remove-serverless
remove-serverless: ## Remove Serverless CR
kubectl delete serverless -n kyma-system default --timeout 2m || (kubectl get serverless -n kyma-system -oyaml && false)
.PHONY: remove-dockerregistry
remove-dockerregistry: ## Remove Dockerregistry CR
kubectl delete dockerregistry -n kyma-system default --timeout 2m || (kubectl get dockerregistry -n kyma-system -oyaml && false)


.PHONY: check-serverless-installation
check-serverless-installation: ## Wait for Serverless CR to be in Ready state.
.PHONY: check-dockerregistry-installation
check-dockerregistry-installation: ## Wait for Dockerregistry CR to be in Ready state.
# wait some time to make sure operator starts the reconciliation first
sleep 10

./hack/verify_dockerregistry_status.sh || \
(make print-serverless-details && false)
(make print-dockerregistry-details && false)

kubectl wait --for condition=Available -n kyma-system deployment dockerregistry-operator --timeout=60s || \
(make print-serverless-details && false)
(make print-dockerregistry-details && false)

.PHONY: print-serverless-details
print-serverless-details: ## Print all pods, deploys and serverless CRs in the kyma-system namespace.
kubectl get serverless -n kyma-system -oyaml
.PHONY: print-dockerregistry-details
print-dockerregistry-details: ## Print all pods, deploys and dockerregistry CRs in the kyma-system namespace.
kubectl get dockerregistry -n kyma-system -oyaml
kubectl get deploy -n kyma-system -oyaml
kubectl get pods -n kyma-system -oyaml

Expand Down
10 changes: 5 additions & 5 deletions hack/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ integration-test: ## Run integration tests on self-prepared k3d cluster.
make -C ${TEST_ROOT} serverless-integration serverless-contract-tests

.PHONY: integration-test-on-cluster
integration-test-on-cluster: ## Install serverless with default serverless-cr, run integration tests and remove serverless-cr
integration-test-on-cluster: ## Install serverless with default dockerregistry-cr, run integration tests and remove dockerregistry-cr
make -C ${PROJECT_ROOT} install-serverless-custom-operator
make integration-test
make -C ${PROJECT_ROOT} remove-serverless
make -C ${PROJECT_ROOT} remove-dockerregistry

.PHONY: git-auth-test-on-cluster
git-auth-test-on-cluster: ## Install serverless with default serverless-cr, run git auth integration and remove serverless-cr
git-auth-test-on-cluster: ## Install serverless with default dockerregistry-cr, run git auth integration and remove dockerregistry-cr
make -C ${PROJECT_ROOT} install-serverless-custom-operator
make -C ${TEST_ROOT} git-auth-integration
make -C ${PROJECT_ROOT} remove-serverless
make -C ${PROJECT_ROOT} remove-dockerregistry

.PHONY: upgrade-test
upgrade-test: ## Installs Serverless from latest, upgrades to version specified in IMG and run integration tests
make -C ${PROJECT_ROOT} install-serverless-latest-release install-serverless-custom-operator
make integration-test
make -C ${PROJECT_ROOT} remove-serverless
make -C ${PROJECT_ROOT} remove-dockerregistry

0 comments on commit f0401af

Please sign in to comment.