fix(talos): fail fast on skopeo copy errors in image-talos

The image-talos recipe chains skopeo copy with `;` in a single shell.
Without `set -e`, the recipe's exit status is the last command's, so a
failed copy in the middle of the chain can be masked by a later
successful command — or worse, by a false-branch `if`/`fi` (which exits
0 and would silently hide a push failure on PR builds where both
PUBLISH_* flags are 0).

Prepend `set -e;` to abort the recipe on the first failure. Also quote
"$SRC" defensively.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
Myasnikov Daniil committed 2026-05-25 12:58:08 +05:00
1 parent ed0297eb87
commit 6c8a67db3d
1 file changed
+4 -3
+4 -3
View File
@@ -12,10 +12,11 @@ image: image-matchbox image-talos
image-talos:
test -f ../../../_out/assets/installer-amd64.tar || make talos-installer
set -e; \
SRC=docker-archive:../../../_out/assets/installer-amd64.tar; \
skopeo copy $$SRC docker://$(REGISTRY)/talos:$(IMAGE_TAG); \
if [ "$(PUBLISH_VERSIONED)" = "1" ]; then skopeo copy $$SRC docker://$(REGISTRY)/talos:$(TALOS_VERSION); fi; \
if [ "$(PUBLISH_FLOATING)" = "1" ]; then skopeo copy $$SRC docker://$(REGISTRY)/talos:latest; fi
skopeo copy "$$SRC" docker://$(REGISTRY)/talos:$(IMAGE_TAG); \
if [ "$(PUBLISH_VERSIONED)" = "1" ]; then skopeo copy "$$SRC" docker://$(REGISTRY)/talos:$(TALOS_VERSION); fi; \
if [ "$(PUBLISH_FLOATING)" = "1" ]; then skopeo copy "$$SRC" docker://$(REGISTRY)/talos:latest; fi
image-matchbox:
test -f ../../../_out/assets/kernel-amd64 || make talos-kernel