Makefile: keep only the base images this module uses
.werf/stages/base-images.yaml defines a werf image for every key of base_images.yml, and Deckhouse's published file has ~1200 keys; a full build started pulling and storing all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4518393ce1
commit
18869e8bfc
@@ -10,6 +10,9 @@
|
|||||||
# registers the module, <SOURCE>/<module>:<version> is the bundle,
|
# registers the module, <SOURCE>/<module>:<version> is the bundle,
|
||||||
# <SOURCE>/<module>/release:<version|channel> is the release image.
|
# <SOURCE>/<module>/release:<version|channel> is the release image.
|
||||||
|
|
||||||
|
empty :=
|
||||||
|
space := $(empty) $(empty)
|
||||||
|
|
||||||
MODULE ?= cluster-map
|
MODULE ?= cluster-map
|
||||||
SOURCE ?= git.project-chimera.ru/fanchji/cluster-map
|
SOURCE ?= git.project-chimera.ru/fanchji/cluster-map
|
||||||
CHANNEL ?= alpha
|
CHANNEL ?= alpha
|
||||||
@@ -34,9 +37,15 @@ render:
|
|||||||
helm template $(MODULE) . --namespace d8-cluster-map $(API_VERSIONS) -f tests/values/default.yaml -f tests/values/no-hubble.yaml > /dev/null
|
helm template $(MODULE) . --namespace d8-cluster-map $(API_VERSIONS) -f tests/values/default.yaml -f tests/values/no-hubble.yaml > /dev/null
|
||||||
@echo render OK
|
@echo render OK
|
||||||
|
|
||||||
# Deckhouse publishes its base image digests; the same file official modules build from.
|
# Deckhouse publishes its base image digests; the same file official modules
|
||||||
|
# build from. .werf/stages/base-images.yaml turns every key into a werf image,
|
||||||
|
# and the full file has ~1200 of them, so only the keys this module uses are kept.
|
||||||
|
BASE_IMAGE_KEYS := REGISTRY_PATH builder/golang-alpine builder/alpine builder/scratch base/distroless jq
|
||||||
|
|
||||||
base_images.yml:
|
base_images.yml:
|
||||||
curl -sfL -o $@ "https://fox.flant.com/api/v4/projects/deckhouse%2Fcontainer-base%2Fbase-images/packages/generic/base_images/$(BASE_IMAGES_VERSION)/base_images.yml"
|
curl -sfL "https://fox.flant.com/api/v4/projects/deckhouse%2Fcontainer-base%2Fbase-images/packages/generic/base_images/$(BASE_IMAGES_VERSION)/base_images.yml" \
|
||||||
|
| grep -E '^($(subst $(space),|,$(BASE_IMAGE_KEYS))):' > $@
|
||||||
|
@test "$$(wc -l < $@)" -eq $(words $(BASE_IMAGE_KEYS)) || (echo "base_images.yml: expected $(words $(BASE_IMAGE_KEYS)) keys"; cat $@; rm -f $@; exit 1)
|
||||||
|
|
||||||
base-images: base_images.yml
|
base-images: base_images.yml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user