Skip to content

Commit

Permalink
Merge pull request #1816 from nalind/prefer-oci
Browse files Browse the repository at this point in the history
pkg/manifests.list.preferOCI() learn about some new OCI fields
  • Loading branch information
openshift-merge-bot[bot] authored Jan 24, 2024
2 parents e2d561c + fb7a7f6 commit 167512e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/manifests/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,22 @@ func FromBlob(manifestBytes []byte) (List, error) {

func (l *list) preferOCI() bool {
// If we have any data that's only in the OCI format, use that.
if l.oci.ArtifactType != "" {
return true
}
if l.oci.Subject != nil {
return true
}
for _, m := range l.oci.Manifests {
if len(m.URLs) > 0 {
if m.ArtifactType != "" {
return true
}
if len(m.Annotations) > 0 {
return true
}
if len(m.Data) > 0 {
return true
}
}
// If we have any data that's only in the Docker format, use that.
for _, m := range l.docker.Manifests {
Expand Down

0 comments on commit 167512e

Please sign in to comment.