diff --git a/cli/server/new.go b/cli/server/new.go index be3b83667..72a8aacba 100644 --- a/cli/server/new.go +++ b/cli/server/new.go @@ -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) }