From 6cd8a874a647a81021170a1d2839e83d0ce417e5 Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Tue, 7 Jun 2022 10:25:41 +0300 Subject: [PATCH] do not try to build or push if no architectures are available Signed-off-by: Avi Deitcher --- src/cmd/linuxkit/pkg_build.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cmd/linuxkit/pkg_build.go b/src/cmd/linuxkit/pkg_build.go index d6fda1029..141774f9a 100644 --- a/src/cmd/linuxkit/pkg_build.go +++ b/src/cmd/linuxkit/pkg_build.go @@ -158,6 +158,14 @@ func pkgBuildPush(args []string, withPush bool) { pkgPlats = append(pkgPlats, imagespec.Platform{OS: "linux", Architecture: a}) } } + + // if there are no platforms to build for, do nothing. + // note that this is *not* an error; we simply skip it + if len(pkgPlats) == 0 { + fmt.Printf("Skipping %s with no architectures to build\n", p.Tag()) + return + } + pkgOpts = append(pkgOpts, pkglib.WithBuildPlatforms(pkgPlats...)) var msg, action string