Fix key generator
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adam Štrauch 2023-04-13 22:36:27 +02:00
parent da5ad13ae3
commit bcc641307a
Signed by: cx
GPG key ID: 018304FFA8988F8D

View file

@ -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
}