Use RELATED_IMAGEs in deploy-dev target
This uses "sed" to parse the output of "kubectl kustomize", which seems
to consistently output YAML in block style. Make variables take
precedence so you can also:
make deploy-dev RELATED_IMAGE_POSTGRES_13=localhost/postgres:13
@@ -109,8 +109,14 @@ deploy:
deploy-dev: build-postgres-operator
$(PGO_KUBE_CLIENT) apply -k ./config/dev
hack/create-kubeconfig.sh postgres-operator pgo
+ env \
CRUNCHY_DEBUG=true \
KUBECONFIG=hack/.kube/postgres-operator/pgo \
+ $(shell $(PGO_KUBE_CLIENT) kustomize ./config/dev | \
+ sed -ne '/^kind: Deployment/,/^---/ { \
+ /RELATED_IMAGE_/ { N; s,.*\(RELATED_[^[:space:]]*\).*value:[[:space:]]*\([^[:space:]]*\),\1="\2",; p; }; \
+ }') \
+ $(foreach v,$(filter RELATED_IMAGE_%,$(.VARIABLES)),$(v)="$($(v))") \
bin/postgres-operator
# Undeploy the PostgreSQL Operator
