domiwar opened a new pull request, #212:
URL: https://github.com/apache/openserverless/pull/212
## What
`build-and-test-windows.ps1` unregisters and rebuilds its WSL distribution on
every run. It defaulted to the distro named `Ubuntu` — the default name for a
stock WSL install — and ran `wsl --unregister` on it with **no
confirmation**.
`--unregister` deletes the distribution's virtual disk and cannot be undone.
I hit this personally: running the script would have destroyed my main
`Ubuntu` WSL distribution and everything in it.
## Changes
- Default to a dedicated distro name (`openserverless-build`) instead of one
a
developer is likely using. Image and distro name are now separate settings
(`WSL_IMAGE` / `WSL_DISTRO`), via `wsl --install -d <image> --name
<distro>`.
- Write an ownership marker during provisioning; refuse to unregister a
distro
that lacks it without a typed confirmation. `-Force` skips the prompt for
CI.
- Pin the image to `Ubuntu-24.04` (the bare `Ubuntu` alias tracks latest
LTS).
Also fixes Docker never actually installing inside the distro: WSL appends
the
Windows PATH, so `command -v docker` matched Docker Desktop's `docker.exe`
and
the install was skipped. Now strips `/mnt/*` from PATH, sets
`appendWindowsPath=false`, downloads the installer to a file instead of
`curl | sh`, enables the docker service, and waits for the daemon.
## Testing
Ran `.\build-and-test-windows.ps1` to completion on Windows 11 / WSL 2.6.3:
all build-and-test scripts reported SUCCESS. Ownership-guard logic verified
against real distros (correctly refuses `Ubuntu`, rebuilds the marked
distro).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]