Skip to content

Helper overlay to patch the Operator image #942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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