From e26afb97af30957424da75c8e91b4bf56ae3429c Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 26 Oct 2021 00:27:22 +0200 Subject: [PATCH] fix: support empty ssh keys --- cli/server/new.go | 7 +++++++ 1 file changed, 7 insertions(+) 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) }