Fix Inconsistent helm repo list behavior

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
pull/10745/head
Kay Yan 4 years ago
parent 2153f70747
commit 71d6cb70e4

@ -39,7 +39,7 @@ func newRepoListCmd(out io.Writer) *cobra.Command {
ValidArgsFunction: noCompletions, ValidArgsFunction: noCompletions,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
f, err := repo.LoadFile(settings.RepositoryConfig) f, err := repo.LoadFile(settings.RepositoryConfig)
if isNotExist(err) || (len(f.Repositories) == 0 && !(outfmt == output.JSON || outfmt == output.YAML)) { if (isNotExist(err) || len(f.Repositories) == 0) && !(outfmt == output.JSON || outfmt == output.YAML) {
return errors.New("no repositories to show") return errors.New("no repositories to show")
} }

Loading…
Cancel
Save