From a3a21985ce43ac7c1f93ce38595353e77d169771 Mon Sep 17 00:00:00 2001 From: Petr Fedchenkov Date: Thu, 15 Dec 2022 14:53:59 +0300 Subject: [PATCH] Assume that image in cache if skipBuild defined If skipBuild defined we should try to push the image Signed-off-by: Petr Fedchenkov --- src/cmd/linuxkit/pkglib/build.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cmd/linuxkit/pkglib/build.go b/src/cmd/linuxkit/pkglib/build.go index fdc767744..17279068d 100644 --- a/src/cmd/linuxkit/pkglib/build.go +++ b/src/cmd/linuxkit/pkglib/build.go @@ -246,9 +246,6 @@ func (p Pkg) Build(bos ...BuildOpt) error { case bo.force: // force local build platformsToBuild = bo.platforms - case bo.skipBuild: - // do not build anything if we explicitly did skipBuild - platformsToBuild = nil default: // check local cache, fallback to check registry / pull image from registry, fallback to build fmt.Fprintf(writer, "checking for %s in local cache...\n", ref) @@ -259,6 +256,8 @@ func (p Pkg) Build(bos ...BuildOpt) error { fmt.Fprintf(writer, "found %s in local cache, skipping build\n", ref) imageInLocalCache = true continue + case bo.skipBuild: + // do nothing, we do not want to pull/build case bo.pull: // need to pull the image from the registry, else build fmt.Fprintf(writer, "%s %s not found in local cache, trying to pull\n", ref, platform.Architecture)