fix: support empty ssh keys

This commit is contained in:
decentral1se 2021-10-26 00:27:22 +02:00
parent 960e47437c
commit e26afb97af
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,10 @@ func newHetznerCloudVPS(c *cli.Context) error {
var sshKeysRaw []string
var sshKeys []*hcloud.SSHKey
for _, sshKey := range c.StringSlice("hetzner-ssh-keys") {
if sshKey == "" {
continue
}
sshKey, _, err := client.SSHKey.GetByName(c.Context, sshKey)
if err != nil {
return err
@ -109,6 +113,9 @@ func newCapsulVPS(c *cli.Context) error {
var sshKeys []string
for _, sshKey := range c.StringSlice("capsul-ssh-keys") {
if sshKey == "" {
continue
}
sshKeys = append(sshKeys, sshKey)
}