Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/steps/input_image_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions pkg/steps/input_image_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestInputImageTagStep(t *testing.T) {
ImportMode: imagev1.ImportModePreserveOriginal,
},
ReferencePolicy: imagev1.TagReferencePolicy{
Type: imagev1.SourceTagReferencePolicy,
Type: imagev1.LocalTagReferencePolicy,
},
},
}
Expand Down Expand Up @@ -233,7 +233,7 @@ func TestInputImageTagStepExternal(t *testing.T) {
ImportMode: imagev1.ImportModePreserveOriginal,
},
ReferencePolicy: imagev1.TagReferencePolicy{
Type: imagev1.SourceTagReferencePolicy,
Type: imagev1.LocalTagReferencePolicy,
},
},
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/steps/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.") ||
Expand Down