Skip to content

Commit

Permalink
Merge pull request #71 from alauda/fix/digest-always-change
Browse files Browse the repository at this point in the history
fix same chart digest always change bug.
  • Loading branch information
youyongsong authored Nov 2, 2022
2 parents d86e02e + 970bdbc commit 3b080e6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/experimental/registry/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@ func (cache *Cache) FetchReference(ref *Reference) (*CacheRefSummary, error) {
if err != nil {
return &r, err
}
r.Manifest = &desc
descCopy := ocispec.Descriptor{
MediaType: desc.MediaType,
Digest: desc.Digest,
Size: desc.Size,
URLs: desc.URLs,
Annotations: desc.Annotations,
Platform: desc.Platform,
}
r.Manifest = &descCopy
r.Config = &manifest.Config
numLayers := len(manifest.Layers)
if numLayers != 1 {
Expand Down Expand Up @@ -147,6 +155,9 @@ func (cache *Cache) FetchReference(ref *Reference) (*CacheRefSummary, error) {
return &r, err
}
r.Chart = ch

// no need to loop anymore
break
}
}
return &r, nil
Expand Down

0 comments on commit 3b080e6

Please sign in to comment.