Skip to content

Commit 7753394

Browse files
committed
build: rebuild every package that has an image target
flux-plunger, keycloak-operator, kilo and migration-controller have image targets but were missing from the root build list, which the build matrix, the main build and release preparation all iterate. No CI path rebuilt them, so their pins stayed on images pushed by hand while Dockerfile, patch and base-image changes never shipped, and the multi-arch pre-release build would find single-arch pins it cannot replace. migration-controller shipped a bare :latest with no digest. Add the four packages, and a test that derives the set from the package Makefiles so a new image target cannot be left out again. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent f02963a commit 7753394

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

‎Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ build: build-deps
1818
make -C packages/system/backup-controller image
1919
make -C packages/system/backupstrategy-controller image
2020
make -C packages/system/lineage-controller-webhook image
21+
make -C packages/system/migration-controller image
2122
make -C packages/system/flux-shard-operator image
23+
make -C packages/system/flux-plunger image
2224
make -C packages/system/cilium image
2325
make -C packages/system/linstor image
2426
make -C packages/system/linstor-gui image
2527
make -C packages/system/kubeovn image
2628
make -C packages/system/kubeovn-webhook image
2729
make -C packages/system/kubeovn-plunger image
30+
make -C packages/system/kilo image
2831
make -C packages/system/dashboard image
2932
make -C packages/system/metallb image
3033
make -C packages/system/talos-log-collector image
@@ -38,6 +41,7 @@ build: build-deps
3841
make -C packages/system/grafana-operator image
3942
make -C packages/system/redis-operator image
4043
make -C packages/system/opensearch-operator image
44+
make -C packages/system/keycloak-operator image
4145
make -C packages/core/testing image
4246
make -C packages/core/talos image
4347
make -C packages/core/platform image

‎docs/agents/image-refs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If a package stamps a reference somewhere the two globs do not cover, add that f
4444

4545
- **Every first-party reference is tag+digest.** A bare tag with no digest is not reproducible and must not be committed. `securitygroup-controller:v0.0.0` is a live violation.
4646
- **Exactly one producer stamps each reference.** A reference no `Makefile` writes will never be refreshed by anything, including release preparation — `chBackupClientImage` in `packages/system/backupstrategy-controller/values.yaml` is a live violation, still pinned to `platform-migrations:v1.4.0-rc.2`.
47-
- **A package that stamps a reference is in the root `Makefile` `build:` list.** `build-matrix.sh`, the main build and release preparation all iterate that one list, so a package outside it is never rebuilt by any path and its pin freezes permanently. `flux-plunger`, `keycloak-operator` and `kilo` are live violations (tracked in #3416).
47+
- **A package that stamps a reference is in the root `Makefile` `build:` list.** `build-matrix.sh`, the main build and release preparation all iterate that one list, so a package outside it is never rebuilt by any path and its pin freezes permanently. `hack/build-matrix_test.bats` computes the set of packages whose Makefile runs `docker buildx build` and fails on any the list misses.
4848
- **Every consumer of references reads all three storage shapes**, via `hack/lib/image-refs.sh`.
4949
- **Scan wider than you rewrite.** A rewrite is deliberately narrow to avoid corrupting vendored defaults, so the check that follows it must not share that blind spot. `hack/promote-rewrite-tags.sh` rewrites the enumerated files, then greps the whole tree and fails if any reference to the release candidate survives.
5050

‎hack/build-matrix_test.bats‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,26 @@
156156
actual=$(echo "$out" | jq 'length')
157157
[ "$expected" -eq "$actual" ]
158158
}
159+
160+
@test "every package that builds an image is in the build list" {
161+
# The build list is maintained by hand, and a package missing from it is
162+
# rebuilt by no CI path: its Dockerfile and patches keep changing while the
163+
# pinned image stays whatever was last pushed by hand. Derive the set from
164+
# the package Makefiles so a new image target cannot be forgotten.
165+
listed=$(sed -n '/^build:/,/^[^[:space:]]/p' Makefile \
166+
| grep -oE 'make -C packages/[A-Za-z0-9._/-]+ image' \
167+
| sed -E 's/^make -C (packages[^ ]+) image$/\1/')
168+
missing=""
169+
checked=0
170+
for m in packages/*/*/Makefile; do
171+
grep -q 'docker buildx build' "$m" || continue
172+
checked=$((checked + 1))
173+
d=${m%/Makefile}
174+
printf '%s\n' "$listed" | grep -qx "$d" || missing="$missing $d"
175+
done
176+
[ "$checked" -gt 0 ]
177+
if [ -n "$missing" ]; then
178+
echo "image-building packages missing from the root Makefile build: list:$missing" >&2
179+
false
180+
fi
181+
}

0 commit comments

Comments
 (0)