Fix key generator
continuous-integration/drone/push Build is passing Details

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
1 changed files with 2 additions and 1 deletions

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
}