Merge pull request #13378 from hierynomus/sshkey-output

Do not return a '-1' exit if no keys found and json/yaml output
This commit is contained in:
Kubernetes Prow Robot 2022-03-28 00:51:22 -07:00 committed by GitHub
commit 3acf5b3634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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