Skip to content

Commit

Permalink
[skip ci] Merge pull request #942 from rabbitmq/ytt-patch
Browse files Browse the repository at this point in the history
Helper overlay to patch the Operator image
  • Loading branch information
Zerpet committed Feb 1, 2022
2 parents de847e8 + 56dcbe3 commit 2c830e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ deploy-kind: check-env-docker-repo git-commit-sha manifests deploy-namespace-rba
kustomize build config/crd | kubectl apply -f -
kustomize build config/default/overlays/kind | sed 's@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' | kubectl apply -f -

QUAY_IO_OPERATOR_IMAGE ?= quay.io/rabbitmqoperator/cluster-operator:latest
# Builds a single-file installation manifest to deploy the Operator
generate-installation-manifest:
mkdir -p releases
kustomize build config/installation/ > releases/rabbitmq-cluster-operator.yaml
ytt -f releases/rabbitmq-cluster-operator.yaml -f config/ytt/overlay-manager-image.yaml --data-value operator_image=$(QUAY_IO_OPERATOR_IMAGE) > releases/rabbitmq-cluster-operator-quay-io.yaml

# Build the docker image
docker-build: check-env-docker-repo git-commit-sha
Expand Down
13 changes: 13 additions & 0 deletions config/ytt/overlay-manager-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")

#@overlay/match by=overlay.subset({"kind": "Deployment", "metadata":{"name": "rabbitmq-cluster-operator"}}), expects="1+"
---
spec:
template:
spec:
containers:
#@overlay/match by="name", expects="1+"
- name: operator
image: #@ data.values.operator_image

0 comments on commit 2c830e9

Please sign in to comment.