Skip to content

Commit

Permalink
Print requested reference tag
Browse files Browse the repository at this point in the history
Signed-off-by: Terry Howe <[email protected]>
  • Loading branch information
Terry Howe committed Feb 22, 2023
1 parent 822fb55 commit 687b324
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/oras/repository/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Example - Show tags of the target OCI layout folder 'layout-dir':
Example - Show tags of the target OCI layout archive 'layout.tar':
oras repo tags --oci-layout layout.tar
Example - Show tags also associated with a particular tagged resource:
Example - Show tags associated with a particular tagged resource:
oras repo tags localhost:5000/hello:latest
Example - Show tags associated with a digest:
Expand Down Expand Up @@ -104,16 +104,17 @@ func showTags(opts showTagsOptions) error {
continue
}
if filter != "" {
if tag == opts.Reference {
fmt.Println(tag)
continue
}
desc, err := finder.Resolve(ctx, tag)
if err != nil {
return err
}
if desc.Digest.String() != filter {
continue
}
if tag == opts.Reference {
continue
}
}
fmt.Println(tag)
}
Expand Down

0 comments on commit 687b324

Please sign in to comment.