Skip to content

Commit

Permalink
fix: correct spec flag description (#964)
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah authored May 31, 2023
1 parent cd7319c commit f4a7aed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/oras/internal/option/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (opts *distributionSpec) Parse() error {
isApi := true
opts.referrersAPI = &isApi
default:
return fmt.Errorf("unknown image specification flag: %q", opts.specFlag)
return fmt.Errorf("unknown distribution specification flag: %q", opts.specFlag)
}
return nil
}
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/suite/command/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ var _ = Describe("ORAS beginners:", func() {
ORAS("attach", "--artifact-type", "oras.test", LayoutRef(root, foobar.Tag)).
ExpectFailure().MatchErrKeyWords("Error: no blob or manifest annotation are provided").Exec()
})

It("should fail if distribution spec is unkown", func() {
ORAS("attach", "--artifact-type", "oras.test", RegistryRef(Host, ImageRepo, foobar.Tag), "--distribution-spec", "???").
ExpectFailure().MatchErrKeyWords("unknown distribution specification flag").Exec()
})

It("should fail if image spec is unkown", func() {
ORAS("attach", "--artifact-type", "oras.test", RegistryRef(Host, ImageRepo, foobar.Tag), "--image-spec", "???").
ExpectFailure().MatchErrKeyWords("unknown image specification flag").Exec()
})
})
})

Expand Down

0 comments on commit f4a7aed

Please sign in to comment.