Files
Timofei Larkin a545ff3781 [redis-operator] Build patched operator in-tree
This patch moves the build of the Redis operator into the Cozystack
organization and patches it to prevent overwriting third-party labels on
owned resources.

```release-note
[redis-operator] Move operator into tree and patch it to retain
third-party labels on owned resources, reducing noisy traffic to the API
server.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-10-23 16:57:27 +03:00

27 lines
1.1 KiB
Makefile

REDIS_OPERATOR_TAG=$(shell grep -F 'ARG VERSION=' images/redis-operator/Dockerfile | cut -f2 -d=)
export NAME=redis-operator
export NAMESPACE=cozy-$(NAME)
include ../../../scripts/common-envs.mk
include ../../../scripts/package.mk
update:
rm -rf charts
helm repo add redis-operator https://spotahome.github.io/redis-operator
helm repo update redis-operator
helm pull redis-operator/redis-operator --untar --untardir charts
sed -i '/{{/d' charts/redis-operator/crds/databases.spotahome.com_redisfailovers.yaml
image:
docker buildx build images/redis-operator \
--tag $(REGISTRY)/redis-operator:$(REDIS_OPERATOR_TAG) \
--cache-from type=registry,ref=$(REGISTRY)/redis-operator:latest \
--cache-to type=inline \
--metadata-file images/redis-operator.json \
$(BUILDX_ARGS)
REPOSITORY="$(REGISTRY)/redis-operator" \
yq -i '.redis-operator.image.repository = strenv(REPOSITORY)' values.yaml
TAG=$(REDIS_OPERATOR_TAG)@$$(yq e '."containerimage.digest"' images/redis-operator.json -o json -r) \
yq -i '.redis-operator.image.tag = strenv(TAG)' values.yaml
rm -f images/redis-operator.json