mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
A lab build's revision carries LAB BUILD(swblock_lab_bigvol), so -version and the volume's /status show it. Every image Dockerfile runs scripts/refuse-lab-binary.sh right after its go build: a binary that is a lab build, or cannot answer -version, stops the image build, so neither the publish workflow nor the image scripts can push one. lab-tag-check.sh now fails closed: an allowlist of the files that may name the tag (git grep; a scan that cannot run fails), plus the wiring (each Dockerfile refuses after its last build; the publish workflow builds only from those, with no go build of its own). Controls cover each contamination and the refusal script's stand-in binaries. The lab headroom test asserts the warning, and both invariant rows name the lab exception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
898 B
Bash
18 lines
898 B
Bash
#!/usr/bin/env bash
|
|
# refuse-lab-binary.sh BIN...: refuse to publish a lab build. Each BIN must
|
|
# answer -version, and its answer must not carry the lab marker
|
|
# (internal/buildinfo LabMarker, set by the swblock_lab_bigvol tag). A binary
|
|
# that cannot answer is refused too (fail closed). Run by every image
|
|
# Dockerfile right after its go build, so no image holding a lab binary is
|
|
# built, and so none is pushed.
|
|
set -euo pipefail
|
|
[ "$#" -gt 0 ] || { echo "refuse-lab-binary: no binary given" >&2; exit 2; }
|
|
for bin in "$@"; do
|
|
out=$("$bin" -version 2>&1) || { echo "refuse-lab-binary: $bin -version failed: $out" >&2; exit 1; }
|
|
[ -n "$out" ] || { echo "refuse-lab-binary: $bin -version printed nothing" >&2; exit 1; }
|
|
case "$out" in
|
|
*"LAB BUILD"*) echo "refuse-lab-binary: $bin is a lab build ($out); not published" >&2; exit 1 ;;
|
|
esac
|
|
echo "refuse-lab-binary: $bin ok: $out"
|
|
done
|