mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-05 11:37:31 +09:00
Pin the 1:1 equivalence between legacy flat preset names and their
instance-type counterparts in helm-unittest for three charts that
exercise different preset shapes:
- postgres — top-level only
- clickhouse — top + nested clickhouseKeeper preset
- opensearch — top + nested dashboards preset
Each case asserts that nano <-> t1.nano, small <-> t1.small,
medium <-> c1.small, large <-> c1.medium, and micro <-> t1.micro
render the same CPU and memory.
packages/apps/{clickhouse,opensearch}/Makefile gain a `test:` target
that calls helm unittest so hack/helm-unit-tests.sh actually runs the
new suites in CI; without it the suites would land as dead weight.
hack/check-rd-presets.sh enforces two invariants in `make unit-tests`:
- every packages/system/*-rd/cozyrds/*.yaml openAPISchema carries
the canonical 47-preset enum (40 instance-type + 7 legacy);
- no chart template carries a hardcoded legacy preset literal in
a defaultingSanitize (list "<legacy>" ...) form.
Both turn an accidental drop of a per-chart Makefile step or an
accidental legacy hardcode into a CI failure rather than silent
production-time validation rejection.
Co-authored-by: Matthieu ROBIN <matthieu@hidora.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
32 lines
1.4 KiB
Makefile
32 lines
1.4 KiB
Makefile
CLICKHOUSE_BACKUP_TAG = $(shell awk '$$0 ~ /^version:/ {print $$2}' Chart.yaml)
|
|
|
|
include ../../../hack/common-envs.mk
|
|
include ../../../hack/package.mk
|
|
|
|
generate:
|
|
cozyvalues-gen -m 'clickhouse' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/clickhouse/types.go
|
|
../../../hack/update-crd.sh
|
|
|
|
test:
|
|
helm unittest .
|
|
|
|
image:
|
|
docker buildx build images/clickhouse-backup \
|
|
--tag $(REGISTRY)/clickhouse-backup:$(call settag,$(CLICKHOUSE_BACKUP_TAG)) \
|
|
--cache-from type=registry,ref=$(REGISTRY)/clickhouse-backup:latest \
|
|
--cache-to type=inline \
|
|
--metadata-file images/clickhouse-backup.json \
|
|
$(BUILDX_ARGS)
|
|
echo "$(REGISTRY)/clickhouse-backup:$(call settag,$(CLICKHOUSE_BACKUP_TAG))@$$(yq e '."containerimage.digest"' images/clickhouse-backup.json -o json -r)" \
|
|
> images/clickhouse-backup.tag
|
|
rm -f images/clickhouse-backup.json
|
|
docker buildx build images/altinity-clickhouse-backup \
|
|
--tag $(REGISTRY)/altinity-clickhouse-backup:$(call settag,$(CLICKHOUSE_BACKUP_TAG)) \
|
|
--cache-from type=registry,ref=$(REGISTRY)/altinity-clickhouse-backup:latest \
|
|
--cache-to type=inline \
|
|
--metadata-file images/altinity-clickhouse-backup.json \
|
|
$(BUILDX_ARGS)
|
|
echo "$(REGISTRY)/altinity-clickhouse-backup:$(call settag,$(CLICKHOUSE_BACKUP_TAG))@$$(yq e '."containerimage.digest"' images/altinity-clickhouse-backup.json -o json -r)" \
|
|
> images/altinity-clickhouse-backup.tag
|
|
rm -f images/altinity-clickhouse-backup.json
|