Files
cozystack/packages/core/platform/Makefile
Andrey Kolkov 647407545d fix(backupstrategy-controller): run backup clients on a package-owned image
The Altinity and RabbitMQ strategy Pods ran platform-migrations, a 349 MB
image carrying kubectl, helm and etcd-migrate whose ENTRYPOINT is the
migration runner, and whose pins were stamped from packages/core/platform
so every migration change moved the backup clients too.

Build images/backup-http-client (alpine + curl + jq + ca-certificates,
non-root) from this package's Makefile and stamp both client keys from
it. The cross-package stamp in packages/core/platform/Makefile and the
platform-migrations-specific check in hack/image-pin-consistency.bats go
away; the general one-digest-per-repository check still covers the two
keys sharing one image.

Fixes #3420

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-10-12 09:54:52 +04:00

48 lines
1.7 KiB
Makefile

NAME=cozystack-platform
NAMESPACE=cozy-system
include ../../../hack/common-envs.mk
test:
helm unittest .
show:
cozyhr show --namespace $(NAMESPACE) $(NAME)
apply:
cozyhr apply --namespace $(NAMESPACE) $(NAME)
reconcile: apply
diff:
cozyhr diff --namespace $(NAMESPACE) $(NAME)
# Strip the platform.cozystack.io/no-delete label from every guarded object so
# `helm uninstall cozy-platform` (and ad-hoc deletes of protected resources)
# is no longer denied by the deletion-protection VAP. After this runs, the
# cluster has no guardrail until the next `helm upgrade` re-stamps the label.
# Intended for teardown / disaster-recovery, not routine use.
unprotect:
hack/unprotect.sh
image: image-migrations
image-migrations:
# Vendor the v1alpha2 CRDs into the build context so migration 50 can ensure
# they exist before adoption (the etcd-operator-crds HelmRelease only installs
# AFTER this pre-upgrade hook). Copied from the committed source of truth —
# no build-time network fetch, stays in lockstep with the chart. Removed again
# after the build; the leading rm reclaims a stale copy from a failed build.
rm -rf images/migrations/etcd-operator-crds
mkdir -p images/migrations/etcd-operator-crds
cp ../../system/etcd-operator-crds/templates/*.yaml images/migrations/etcd-operator-crds/
docker buildx build images/migrations \
$(call image-tags,platform-migrations,v$(COZYSTACK_VERSION)) \
$(call cache-args,platform-migrations) \
--metadata-file images/migrations.json \
$(BUILDX_ARGS)
rm -rf images/migrations/etcd-operator-crds
IMAGE="$(REGISTRY)/platform-migrations:$(IMAGE_TAG)@$$(yq -e -o json -r '.["containerimage.digest"]' images/migrations.json)" \
yq --inplace '.migrations.image = strenv(IMAGE)' values.yaml
rm -f images/migrations.json