From 5fd9d1b6afe16f846d83ddeeef8c0e005c455603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Thu, 17 Oct 2024 23:05:18 +0200 Subject: [PATCH] Special-case an error message to make it clearer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... and, also, indirectly, confirm the hypothesis in https://github.com/containers/podman/issues/24308 . Signed-off-by: Miloslav Trmač --- storage/storage_dest.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/storage_dest.go b/storage/storage_dest.go index c71616cac..c0cf0a276 100644 --- a/storage/storage_dest.go +++ b/storage/storage_dest.go @@ -335,6 +335,11 @@ func (s *storageImageDestination) PutBlobPartial(ctx context.Context, chunkAcces out, err := s.imageRef.transport.store.PrepareStagedLayer(nil, differ) if err != nil { + // Special-case the error message + var perr chunked.ErrFallbackToOrdinaryLayerDownload + if errors.Is(err, storage.ErrNotSupported) && !errors.As(err, &perr) { + err = fmt.Errorf("partial layer pull is not supported by the graph driver, and fallback is not allowed: %w", err) + } return private.UploadedBlob{}, err } succeeded := false