fix: create directory before writing coder connect network info file (#17628)

The regular network info file creation code also calls `Mkdirall`.

Wasn't picked up in manual testing as I already had the `/net` folder in
my VSCode.

Wasn't picked up in automated testing because we use an in-memory FS,
which for some reason does this implicitly.
This commit is contained in:
Ethan
2025-05-01 16:53:13 +10:00
committed by GitHub
parent 4de7661c0b
commit c7fc7b91ec

View File

@ -1542,6 +1542,10 @@ func writeCoderConnectNetInfo(ctx context.Context, networkInfoDir string) error
if !ok {
fs = afero.NewOsFs()
}
if err := fs.MkdirAll(networkInfoDir, 0o700); err != nil {
return xerrors.Errorf("mkdir: %w", err)
}
// The VS Code extension obtains the PID of the SSH process to
// find the log file associated with a SSH session.
//