From b65dd71d542d47781dcf966f7f2ae84fde2165f1 Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Wed, 8 May 2024 11:54:12 +0000 Subject: [PATCH] fix e2e Signed-off-by: Billy Zha --- cmd/oras/root/manifest/fetch.go | 2 +- test/e2e/suite/command/discover.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/oras/root/manifest/fetch.go b/cmd/oras/root/manifest/fetch.go index 591a0c48d..c678e69ba 100644 --- a/cmd/oras/root/manifest/fetch.go +++ b/cmd/oras/root/manifest/fetch.go @@ -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") diff --git a/test/e2e/suite/command/discover.go b/test/e2e/suite/command/discover.go index 4e0f4dc08..8cdcf5ff1 100644 --- a/test/e2e/suite/command/discover.go +++ b/test/e2e/suite/command/discover.go @@ -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() })