Conversation
…l-k8s.ps1 - Added functionality to update the kubeconfig file, replacing 'host.docker.internal' with '127.0.0.1' if the file exists, ensuring proper connectivity. - Captured and logged Helm output during installation for better visibility and troubleshooting, enhancing user experience during the installation process.
- Changed the command to execute the script using 'powershell.exe -ExecutionPolicy Bypass -File' to ensure proper execution policy handling. - This modification enhances the security and reliability of script execution during the installation process.
|
|
||
| try { | ||
| & $ScriptDest @args | ||
| powershell.exe -ExecutionPolicy Bypass -File $ScriptDest @args |
There was a problem hiding this comment.
Child process exit code not propagated to parent
High Severity
Switching from & $ScriptDest @args (same-session) to powershell.exe -ExecutionPolicy Bypass -File $ScriptDest @args (child process) means the installer's exit code is no longer propagated. The install-k8s.ps1 script uses exit 1 and exit 2 for various failure paths (including the Err function), but after the child powershell.exe terminates, $LASTEXITCODE is never checked or forwarded. The parent always exits with code 0, silently masking installation failures.
- Implemented timeout handling for WSL update and setting default version, improving script robustness. - Added job management for WSL commands to prevent hanging processes and provide user feedback on potential issues. - Improved logging and hints for manual intervention when WSL commands fail or time out, enhancing user experience during installation.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| Stop-Job $wslSetJob; Remove-Job $wslSetJob -Force | ||
| Warn "Could not set WSL2 as default." | ||
| Hint "Try running 'wsl --update' manually, then re-run this script." | ||
| Hint "Try running 'wsl --set-default-version 2' manually." |
There was a problem hiding this comment.
WSL set-default-version success check ignores command exit code
Medium Severity
The old code verified wsl --set-default-version 2 succeeded by checking $LASTEXITCODE -eq 0. The new code only checks whether the background job completed within the timeout via Wait-Job, but Wait-Job returns the job object regardless of whether the command inside exited with a non-zero code — the job state is "Completed" either way. So if the WSL command fails, the script still logs "WSL2 set as default." and the user never sees the warning or the hint to run it manually.


Note
Medium Risk
Touches the Windows installer flow for WSL, GPU setup, cluster creation, and Helm install; the new timeouts and process/job handling could change behavior on slower machines or leave steps skipped, affecting install reliability.
Overview
Improves Windows installation robustness by adding explicit timeouts around WSL operations (update, default-version set, distro listing) and NVIDIA Container Toolkit setup, with clearer warnings/hints when steps are skipped or require manual follow-up.
Reworks
k3d cluster createexecution to run viaStart-Processwith a progress spinner and captured stdout/stderr logging, applies a post-merge kubeconfig rewrite fromhost.docker.internalto127.0.0.1, and logs Helm install output (including it in failure messages). The bootstrapinstall.ps1now invokes the downloaded script viapowershell.exe -ExecutionPolicy Bypassfor more consistent execution.Written by Cursor Bugbot for commit 80e6685. This will update automatically on new commits. Configure here.