From 5c02688b59e3246fa47510d83273af839d3054c3 Mon Sep 17 00:00:00 2001 From: ktock Date: Thu, 15 Apr 2021 19:04:03 +0900 Subject: [PATCH] converter: use OpenWriter helper function When several goroutines call uncompress converter in parallel, the ref name conflicts each other. This leads to Writer method failing with Unavaliable error without retry. For solving this issue, OpenWriter helper should be used. This allows them to retry in such situations. Signed-off-by: Kohei Tokunaga --- images/converter/uncompress/uncompress.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/converter/uncompress/uncompress.go b/images/converter/uncompress/uncompress.go index b77294cb1..aca003552 100644 --- a/images/converter/uncompress/uncompress.go +++ b/images/converter/uncompress/uncompress.go @@ -55,7 +55,7 @@ func LayerConvertFunc(ctx context.Context, cs content.Store, desc ocispec.Descri } defer newR.Close() ref := fmt.Sprintf("convert-uncompress-from-%s", desc.Digest) - w, err := cs.Writer(ctx, content.WithRef(ref)) + w, err := content.OpenWriter(ctx, cs, content.WithRef(ref)) if err != nil { return nil, err }