Skip to content

Commit

Permalink
Test all-in-one.yaml from make
Browse files Browse the repository at this point in the history
  • Loading branch information
josvazg committed May 8, 2024
1 parent c2cde66 commit 110d284
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ OPERATOR_NAMESPACE=atlas-operator
OPERATOR_POD_NAME=mongodb-atlas-operator
RUN_YAML= # Set to the YAML to run when calling make run

LOCAL_IMAGE=mongodb-atlas-kubernetes-operator:compiled
CONTAINER_SPEC=.spec.template.spec.containers[0]

.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help screen
Expand Down Expand Up @@ -527,3 +530,26 @@ endif
bin/manager --object-deletion-protection=false --log-level=debug \
--atlas-domain=$(MCLI_OPS_MANAGER_URL) \
--global-api-secret-name=mongodb-atlas-operator-api-key

.PHONY: local-docker-build
local-docker-build:
docker build -t $(LOCAL_IMAGE) .

.PHONY: yq
yq:
go install github.com/mikefarah/yq/v4@latest

.PHONY: prepare-all-in-one
prepare-all-in-one: yq local-docker-build run-kind
kubectl create namespace mongodb-atlas-system || echo "Namespace already in place"
kind load docker-image $(LOCAL_IMAGE)

.PHONY: test-all-in-one
test-all-in-one: prepare-all-in-one install-credentials ## Test the deploy/all-in-one.yaml definition
# Test all in one with a local image and at $(ATLAS_DOMAIN) (cloud-qa)
kubectl apply -f deploy/all-in-one.yaml
yq deploy/all-in-one.yaml \
| yq 'select(.kind == "Deployment") | $(CONTAINER_SPEC).imagePullPolicy="IfNotPresent"' \
| yq 'select(.kind == "Deployment") | $(CONTAINER_SPEC).image="$(LOCAL_IMAGE)"' \
| yq 'select(.kind == "Deployment") | $(CONTAINER_SPEC).args[0]="--atlas-domain=$(ATLAS_DOMAIN)"' \
| kubectl apply -f -

0 comments on commit 110d284

Please sign in to comment.