mirror of https://github.com/kubernetes/kops.git
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:
commit
3acf5b3634
|
|
@ -105,12 +105,12 @@ func RunGetSSHPublicKeys(ctx context.Context, f *util.Factory, out io.Writer, op
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(items) == 0 {
|
|
||||||
return fmt.Errorf("no SSH public key found")
|
|
||||||
}
|
|
||||||
switch options.Output {
|
switch options.Output {
|
||||||
|
|
||||||
case OutputTable:
|
case OutputTable:
|
||||||
|
if len(items) == 0 {
|
||||||
|
return fmt.Errorf("no SSH public key found")
|
||||||
|
}
|
||||||
t := &tables.Table{}
|
t := &tables.Table{}
|
||||||
t.AddColumn("ID", func(i *SSHKeyItem) string {
|
t.AddColumn("ID", func(i *SSHKeyItem) string {
|
||||||
return i.ID
|
return i.ID
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue