0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-02 03:22:59 +00:00

fix(provider): race condition in~/.ssh path existence check (#1052)

fix: ignore error if path exists

Signed-off-by: Fabian Franz <fabian.franz@sva.de>
Co-authored-by: Fabian Franz <fabian.franz@sva.de>
This commit is contained in:
Fabian Franz 2024-02-23 04:24:29 +01:00 committed by GitHub
parent 16511af72a
commit f7f67dbd3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -256,7 +256,7 @@ func (c *client) openNodeShell(ctx context.Context, node ProxmoxNode) (*ssh.Clie
sshPath := path.Join(homeDir, ".ssh")
if _, err = os.Stat(sshPath); os.IsNotExist(err) {
e := os.Mkdir(sshPath, 0o700)
if e != nil {
if e != nil && !os.IsExist(e) {
return nil, fmt.Errorf("failed to create %s: %w", sshPath, e)
}
}