bugfix: avoid to re-calculate blob state for schema1#2595
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2595 +/- ##
=======================================
Coverage 44.03% 44.03%
=======================================
Files 94 94
Lines 10235 10235
=======================================
Hits 4507 4507
Misses 5008 5008
Partials 720 720
Continue to review full report at Codecov.
|
|
ping @AkihiroSuda @dmcgowan and @stevvooe Please take a look at this, thanks. |
remotes/docker/schema1/converter.go
Outdated
There was a problem hiding this comment.
Re-use "containerd.io/uncompressed" here instead of using a structured value. Maybe we can have containerd.io/legacy.schema1.empty to determine if a tar layer is empty. In that past we have hardcoded the uncompressed empty tar digest but not sure if that is reliable enough.
For media type, could just use this logic... if uncompressed == blob images.MediaTypeDockerSchema2Layer else images.MediaTypeDockerSchema2LayerGzip. Nothing else is supported for schema1, no need to store it
There was a problem hiding this comment.
Actually after reading back through this code, I don't believe empty is relevant at this part of the code. The empty attribute is determined by manifest, which is always loaded first. If the blob was empty, fetch will never be attempted and this code would not be called. So this code will only be called on non-empty layers. For empty layers, they are only included as part of the history and not part of the hash id calculation for the layer, so they never have a relevant diffid.
https://github.com/containerd/containerd/blob/master/remotes/docker/schema1/converter.go#L95
a6e0c48 to
fa15652
Compare
|
ping @dmcgowan updated it and please take a look. |
Use containerd.io/uncompressed label to avoid to re-calculate blob diffID. Signed-off-by: Wei Fu <fuweid89@gmail.com>
fa15652 to
9db21de
Compare
|
LGTM |
1 similar comment
|
LGTM |
Use containerd.io/uncompressed label to avoid to re-calculate blob
diffID.
Signed-off-by: Wei Fu fuweid89@gmail.com