Skip to content

Commit

Permalink
fix same chart digest always change bug.
Browse files Browse the repository at this point in the history
never use range value reference!
youyongsong committed Nov 2, 2022
1 parent d86e02e commit 970bdbc
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
@@ -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 {
@@ -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

0 comments on commit 970bdbc

Please sign in to comment.