From 058bc083a862a11f5c94be7444b9bfddb1156409 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> Date: Wed, 7 May 2025 00:38:13 +0530 Subject: [PATCH 1/4] changed Error to print Signed-off-by: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> --- pkg/cmd/repo_list.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/repo_list.go b/pkg/cmd/repo_list.go index 60c879984..fbd0ee8c1 100644 --- a/pkg/cmd/repo_list.go +++ b/pkg/cmd/repo_list.go @@ -40,7 +40,8 @@ func newRepoListCmd(out io.Writer) *cobra.Command { RunE: func(_ *cobra.Command, _ []string) error { f, _ := repo.LoadFile(settings.RepositoryConfig) if len(f.Repositories) == 0 && outfmt != output.JSON && outfmt != output.YAML { - return errors.New("no repositories to show") + fmt.Fprintln(out, "no repositories to show") + return nil } return outfmt.Write(out, &repoListWriter{f.Repositories}) From 95328ea0a699edfc0efd06e7de1266a9dcd867e8 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> Date: Wed, 7 May 2025 02:11:46 +0530 Subject: [PATCH 2/4] removed error import Signed-off-by: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> --- pkg/cmd/repo_list.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/cmd/repo_list.go b/pkg/cmd/repo_list.go index fbd0ee8c1..cbd0a69ad 100644 --- a/pkg/cmd/repo_list.go +++ b/pkg/cmd/repo_list.go @@ -17,7 +17,6 @@ limitations under the License. package cmd import ( - "errors" "fmt" "io" From e63cbae886ad3de2f6c850820d9867b7913a964c Mon Sep 17 00:00:00 2001 From: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> Date: Wed, 7 May 2025 02:46:58 +0530 Subject: [PATCH 3/4] added cmd.ErrOrStderr() Signed-off-by: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> --- pkg/cmd/repo_list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/repo_list.go b/pkg/cmd/repo_list.go index cbd0a69ad..6fd297334 100644 --- a/pkg/cmd/repo_list.go +++ b/pkg/cmd/repo_list.go @@ -39,7 +39,7 @@ func newRepoListCmd(out io.Writer) *cobra.Command { RunE: func(_ *cobra.Command, _ []string) error { f, _ := repo.LoadFile(settings.RepositoryConfig) if len(f.Repositories) == 0 && outfmt != output.JSON && outfmt != output.YAML { - fmt.Fprintln(out, "no repositories to show") + fmt.Fprintln(cmd.ErrOrStderr(), "no repositories to show") return nil } From 56b688145fb1844295af25d8f93b47d8cc88fbaf Mon Sep 17 00:00:00 2001 From: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> Date: Tue, 13 May 2025 18:22:11 +0530 Subject: [PATCH 4/4] added cmd in repo_list.go for pipeline Co-authored-by: Terry Howe Signed-off-by: Ayush Tiwari <55987406+ayushontop@users.noreply.github.com> --- pkg/cmd/repo_list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/repo_list.go b/pkg/cmd/repo_list.go index 6fd297334..b7a36cbf7 100644 --- a/pkg/cmd/repo_list.go +++ b/pkg/cmd/repo_list.go @@ -36,7 +36,7 @@ func newRepoListCmd(out io.Writer) *cobra.Command { Short: "list chart repositories", Args: require.NoArgs, ValidArgsFunction: noMoreArgsCompFunc, - RunE: func(_ *cobra.Command, _ []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { f, _ := repo.LoadFile(settings.RepositoryConfig) if len(f.Repositories) == 0 && outfmt != output.JSON && outfmt != output.YAML { fmt.Fprintln(cmd.ErrOrStderr(), "no repositories to show")