Skip to content

Commit

Permalink
fix image ref keys getting squashed when containing sigs/atts (#291)
Browse files Browse the repository at this point in the history
* fix image ref keys getting squashed when containing sigs/atts

Signed-off-by: Adam Martin <[email protected]>

---------

Signed-off-by: Adam Martin <[email protected]>
Signed-off-by: Adam Martin <[email protected]>
Co-authored-by: Adam Martin <[email protected]>
  • Loading branch information
amartin120 and amartin120 authored Aug 13, 2024
1 parent ef3eb05 commit c592551
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/content/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ func (o *OCI) AddIndex(desc ocispec.Descriptor) error {
if strings.TrimSpace(key.String()) != "--" {
switch key.(type) {
case name.Digest:
o.nameMap.Store(key.Context().String(), desc)
o.nameMap.Store(fmt.Sprintf("%s-%s", key.Context().String(), desc.Annotations[consts.KindAnnotationName]), desc)
case name.Tag:
o.nameMap.Store(key.String(), desc)
o.nameMap.Store(fmt.Sprintf("%s-%s", key.String(), desc.Annotations[consts.KindAnnotationName]), desc)
}
}
return o.SaveIndex()
Expand Down Expand Up @@ -93,9 +93,9 @@ func (o *OCI) LoadIndex() error {
if strings.TrimSpace(key.String()) != "--" {
switch key.(type) {
case name.Digest:
o.nameMap.Store(key.Context().String(), desc)
o.nameMap.Store(fmt.Sprintf("%s-%s", key.Context().String(), desc.Annotations[consts.KindAnnotationName]), desc)
case name.Tag:
o.nameMap.Store(key.String(), desc)
o.nameMap.Store(fmt.Sprintf("%s-%s", key.String(), desc.Annotations[consts.KindAnnotationName]), desc)
}
}
}
Expand Down

0 comments on commit c592551

Please sign in to comment.