Skip to content

Commit

Permalink
modified a function
Browse files Browse the repository at this point in the history
Signed-off-by: wangxiaoxuan273 <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Oct 24, 2022
1 parent 7230714 commit 2f5ef79
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions manifest/ociartifact/artifact_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ type ArtifactManifest struct {
}

// References returns the descriptors of this artifact manifest references.
func (m ArtifactManifest) References() []distribution.Descriptor {
references := make([]distribution.Descriptor, 0, 1+len(m.Blobs))
references = append(references, m.Blobs...)
references = append(references, m.Subject)
func (am ArtifactManifest) References() []distribution.Descriptor {
var references []distribution.Descriptor
references = append(references, am.Blobs...)
// if Subject exists, append it to references, this part needs more design
if am.Subject.Digest != "" {
references = append(references, am.Subject)
}
return references
}

Expand Down

0 comments on commit 2f5ef79

Please sign in to comment.