From f7f67dbd3d3edb2b6e092b77c898962d7641256f Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Fri, 23 Feb 2024 04:24:29 +0100 Subject: [PATCH] fix(provider): race condition in`~/.ssh` path existence check (#1052) fix: ignore error if path exists Signed-off-by: Fabian Franz Co-authored-by: Fabian Franz --- proxmox/ssh/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox/ssh/client.go b/proxmox/ssh/client.go index 16c545a6..47dfb8da 100644 --- a/proxmox/ssh/client.go +++ b/proxmox/ssh/client.go @@ -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) } }