Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed May 8, 2024
1 parent 2d86e91 commit b65dd71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/oras/root/manifest/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Example - Fetch raw manifest from an OCI layout archive file 'layout.tar':
Args: oerrors.CheckArgs(argument.Exactly(1), "the manifest to fetch"),
PreRunE: func(cmd *cobra.Command, args []string) error {
switch {
case opts.outputPath == "-" && opts.Template != "":
case opts.outputPath == "-" && opts.Input != "":
return fmt.Errorf("`--output -` cannot be used with `--format %s` at the same time", opts.Template)
case opts.outputPath == "-" && opts.OutputDescriptor:
return fmt.Errorf("`--descriptor` cannot be used with `--output -` at the same time")
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/suite/command/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ var _ = Describe("ORAS beginners:", func() {
})

It("should fail if invalid output type is used", func() {
ORAS("discover", RegistryRef(ZOTHost, ImageRepo, foobar.Tag), "--output", "ukpkmkk").
invalidType := "ukpkmkk"
ORAS("discover", RegistryRef(ZOTHost, ImageRepo, foobar.Tag), "--output", invalidType).
ExpectFailure().
MatchErrKeyWords("Error:", "output type can only be tree, table or json").
MatchErrKeyWords("Error:", "invalid format type", invalidType, "tree", "table", "json", "go-template").
Exec()
})

Expand Down

0 comments on commit b65dd71

Please sign in to comment.