Merge pull request #10519 from teozkr/bugfix/repo-list-not-found

fix(helm): ignore file-not-found error for `helm repo list -o json`
pull/10960/head
Matthew Fisher 2 years ago committed by GitHub
commit 81808b06d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save