Check for key already exists
This commit is contained in:
parent
919dcebc45
commit
9f6e1c774b
1 changed files with 3 additions and 1 deletions
|
|
@ -127,7 +127,9 @@ func (a *App) SSH(ctx context.Context, sshArgs []string, opts sshOptions) (err e
|
||||||
if shouldGenerateSSHKeys(args, opts) && sshContext.HasKeygen() {
|
if shouldGenerateSSHKeys(args, opts) && sshContext.HasKeygen() {
|
||||||
keyPair, err := sshContext.GenerateSSHKey("codespaces", "")
|
keyPair, err := sshContext.GenerateSSHKey("codespaces", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to generate ssh keys: %s", err)
|
if _, ok := err.(*ssh.KeyAlreadyExistsError); !ok {
|
||||||
|
return fmt.Errorf("failed to generate ssh keys: %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startSSHOptions.UserPublicKeyFile = keyPair.PublicKeyPath
|
startSSHOptions.UserPublicKeyFile = keyPair.PublicKeyPath
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue