From bcc641307a0b20ba7ed52f7597ba0c892c77f4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Thu, 13 Apr 2023 22:36:27 +0200 Subject: [PATCH] Fix key generator --- containers/types.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/containers/types.go b/containers/types.go index 8b18c07..0e651ac 100644 --- a/containers/types.go +++ b/containers/types.go @@ -1,6 +1,7 @@ package containers import ( + "bytes" "errors" "fmt" "log" @@ -273,7 +274,7 @@ func (c *Container) GetDeploySSHKeys() (string, string, error) { return "", "", err } - if privateKey != nil || pubKey != nil { + if privateKey != nil && pubKey != nil && !bytes.Contains(*privateKey, []byte("No such file")) && !bytes.Contains(*pubKey, []byte("No such file")) { return string(*privateKey), string(*pubKey), nil }