Skip to content

Commit

Permalink
fix: fix get diffid blob not found
Browse files Browse the repository at this point in the history
If the cache is hit during image conversion,  we need to add an uncompressed label to the Info method, otherwise containerd will attempt to update the cache layer label, resulting in error not found

Signed-off-by: YuQiang <y_q_email@163.com>
  • Loading branch information
PerseidMeteor committed Oct 9, 2023
1 parent 9c86e7c commit 6364a4c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
ctrcontent "github.com/containerd/containerd/content"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/labels"
"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/metadata"
"github.com/containerd/containerd/metadata/boltutil"
Expand Down Expand Up @@ -253,6 +254,10 @@ func (content *Content) Info(ctx context.Context, dgst digest.Digest) (ctrconten
layers := remoteCache.Values()
for _, layer := range layers {
if layer.Digest == dgst {
if layer.Annotations == nil {
layer.Annotations = map[string]string{}
}
layer.Annotations[labels.LabelUncompressed] = layer.Digest.String()
return ctrcontent.Info{
Digest: layer.Digest,
Size: layer.Size,
Expand Down

0 comments on commit 6364a4c

Please sign in to comment.