From 36ca55790a9b903abf5991a8cff2fed8a7cdff46 Mon Sep 17 00:00:00 2001 From: Prucek Date: Tue, 28 Apr 2026 11:13:07 +0200 Subject: [PATCH] fix: use LocalTagReferencePolicy for input image tags Builds pull base images from the internal registry instead of quay-proxy, avoiding "manifest unknown" failures when quay.io garbage-collects a digest after import. Co-Authored-By: Claude Opus 4.6 --- pkg/steps/input_image_tag.go | 2 +- pkg/steps/input_image_tag_test.go | 4 ++-- pkg/steps/source.go | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/steps/input_image_tag.go b/pkg/steps/input_image_tag.go index 1e009d8e5fc..d2e1bfd5ae8 100644 --- a/pkg/steps/input_image_tag.go +++ b/pkg/steps/input_image_tag.go @@ -108,7 +108,7 @@ func (s *inputImageTagStep) run(ctx context.Context) error { }, Tag: &imagev1.TagReference{ ReferencePolicy: imagev1.TagReferencePolicy{ - Type: imagev1.SourceTagReferencePolicy, + Type: imagev1.LocalTagReferencePolicy, }, From: from, ImportPolicy: imagev1.TagImportPolicy{ diff --git a/pkg/steps/input_image_tag_test.go b/pkg/steps/input_image_tag_test.go index 453a9eeda2f..bc2c061bb25 100644 --- a/pkg/steps/input_image_tag_test.go +++ b/pkg/steps/input_image_tag_test.go @@ -120,7 +120,7 @@ func TestInputImageTagStep(t *testing.T) { ImportMode: imagev1.ImportModePreserveOriginal, }, ReferencePolicy: imagev1.TagReferencePolicy{ - Type: imagev1.SourceTagReferencePolicy, + Type: imagev1.LocalTagReferencePolicy, }, }, } @@ -233,7 +233,7 @@ func TestInputImageTagStepExternal(t *testing.T) { ImportMode: imagev1.ImportModePreserveOriginal, }, ReferencePolicy: imagev1.TagReferencePolicy{ - Type: imagev1.SourceTagReferencePolicy, + Type: imagev1.LocalTagReferencePolicy, }, }, } diff --git a/pkg/steps/source.go b/pkg/steps/source.go index ac18768008b..5f44e269d9e 100644 --- a/pkg/steps/source.go +++ b/pkg/steps/source.go @@ -435,6 +435,11 @@ func handleFailedBuild(ctx context.Context, client BuildClient, ns, name string, return err } + if isNonRetriableInfraError(b.Status.LogSnippet) { + logrus.Infof("Build %s failed with non-retriable infrastructure error (%s), will not be retried", name, b.Status.Reason) + return err + } + logrus.Infof("Build %s previously failed from an infrastructure error (%s), retrying...", name, b.Status.Reason) // Remove workload from metrics watching since we're about to delete and recreate the build @@ -632,6 +637,10 @@ func isInfraReason(reason buildapi.StatusReason) bool { return false } +func isNonRetriableInfraError(logSnippet string) bool { + return strings.Contains(logSnippet, "manifest unknown") +} + func hintsAtInfraReason(logSnippet string) bool { return strings.Contains(logSnippet, "error: build error: no such image") || strings.Contains(logSnippet, "[Errno 256] No more mirrors to try.") ||