Skip to content

Commit

Permalink
Merge pull request #13424 from hakman/automated-cherry-pick-of-#13378…
Browse files Browse the repository at this point in the history
…-upstream-release-1.23

Automated cherry pick of #13378: Do not return a '-1' exit if no keys found and json/yaml
  • Loading branch information
k8s-ci-robot authored Mar 28, 2022
2 parents fd4e9c3 + 9356bc1 commit d978b68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/kops/get_sshpublickeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ func RunGetSSHPublicKeys(ctx context.Context, f *util.Factory, out io.Writer, op
items = append(items, item)
}

if len(items) == 0 {
return fmt.Errorf("no SSH public key found")
}
switch options.Output {

case OutputTable:
if len(items) == 0 {
return fmt.Errorf("no SSH public key found")
}
t := &tables.Table{}
t.AddColumn("ID", func(i *SSHKeyItem) string {
return i.ID
Expand Down

0 comments on commit d978b68

Please sign in to comment.