@@ -97,7 +97,9 @@ func NewImageStore(rootDir string, cacheDir string, dedupe, commit bool, log zlo
9797 if dedupe {
9898 // create the global blobs repo which will serve as the master copy for
9999 // all blobs
100- imgStore .initRepo (constants .GlobalBlobsRepo )
100+ if err := imgStore .initRepo (constants .GlobalBlobsRepo ); err != nil {
101+ log .Fatal ().Err (err ).Str ("rootDir" , rootDir ).Msg ("failed to create global blobs repo" )
102+ }
101103 }
102104
103105 return imgStore
@@ -1160,31 +1162,28 @@ retry:
11601162 // digest in the global blobs repo
11611163 gdst := is .BlobPath (constants .GlobalBlobsRepo , dstDigest )
11621164
1165+ is .log .Debug ().Str ("src" , src ).Str ("dst" , dst ).Str ("gdst" , gdst ).Str ("component" , "dedupe" ).Msg ("first time" )
1166+
11631167 if err := is .cache .PutBlob (dstDigest , gdst ); err != nil {
1164- is .log .Error ().Err (err ).Str ("blobPath" , dst ).Str ("component" , "dedupe" ).
1168+ is .log .Error ().Err (err ).Str ("blobPath" , gdst ).Str ("component" , "dedupe" ).
11651169 Msg ("failed to insert blob record" )
11661170
11671171 return err
11681172 }
11691173
11701174 // move the blob from uploads to final dest
11711175 if err := is .storeDriver .Move (src , gdst ); err != nil {
1172- is .log .Error ().Err (err ).Str ("src" , src ).Str ("dst" , dst ).Str ("component" , "dedupe" ).
1176+ is .log .Error ().Err (err ).Str ("src" , src ).Str ("dst" , gdst ).Str ("component" , "dedupe" ).
11731177 Msg ("failed to rename blob" )
11741178
11751179 return err
11761180 }
11771181
11781182 blobUploadRemoved = true
11791183
1180- dstRecord , err = is .cache .GetBlob (dstDigest )
1181- if err := inject .Error (err ); err != nil && ! errors .Is (err , zerr .ErrCacheMiss ) {
1182- is .log .Error ().Err (err ).Str ("blobPath" , dst ).Str ("component" , "dedupe" ).Msg ("failed to lookup blob record" )
1183-
1184- return err
1185- }
1184+ dstRecord = gdst
11861185
1187- is .log .Debug ().Str ("src" , src ).Str ("dst" , dst ).Str ("component" , "dedupe" ).Msg ("rename" )
1186+ is .log .Debug ().Str ("src" , src ).Str ("dst" , dst ).Str ("dstRecord" , dstRecord ). Str ( " component" , "dedupe" ).Msg ("rename" )
11881187 }
11891188
11901189 // cache record exists, but due to GC and upgrades from older versions,
0 commit comments