Skip to content

Fix bootstrap failure on Windows cross-drive paths#5726

Merged
stefanprodan merged 1 commit into
fluxcd:mainfrom
veeceey:fix/issue-1153-windows-cross-drive-bootstrap
Feb 24, 2026
Merged

Fix bootstrap failure on Windows cross-drive paths#5726
stefanprodan merged 1 commit into
fluxcd:mainfrom
veeceey:fix/issue-1153-windows-cross-drive-bootstrap

Conversation

@veeceey

@veeceey veeceey commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #1153

When running flux bootstrap (or flux install) from a drive different than where %TEMP% lives (e.g. working dir on D:\, temp on C:\), Go's filepath.Rel returns an error because it can't compute a relative path across Windows drive letters. The CLI just propagated that error and died.

The relative path conversion was originally added as a workaround for kubernetes-sigs/kustomize#2789, which was caused by kustomize's old go-getter dependency. Kustomize dropped go-getter back in 2021 (kubernetes-sigs/kustomize#3586), so absolute paths work fine now.

The fix: when filepath.Rel fails, keep the absolute path instead of returning an error. The relative conversion still happens when possible (same drive), so behavior on Linux/macOS is unchanged.

I don't have a Windows box to test on directly, but the code path is straightforward — the change is from if err != nil { return nil, err } to just skipping the relative conversion on error. @kitforbes or @domoran mentioned being able to test on Windows if someone provides the fix.

Signed-off-by: Varun Chawla varun_6april@hotmail.com

…nt drive than TEMP

When running flux bootstrap from a drive (e.g. D:\) different from
where %TEMP% lives (typically C:\), filepath.Rel fails because Go
can't compute relative paths across different drive letters.

The original code converted absolute paths to relative as a workaround
for a kustomize bug (kubernetes-sigs/kustomize#2789) that was caused
by go-getter. Since kustomize dropped go-getter in 2021, absolute
paths work fine now. Instead of hard-failing when filepath.Rel errors,
keep the absolute path as a fallback.

Signed-off-by: Varun Chawla <varun_6april@hotmail.com>

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stefanprodan stefanprodan added the area/bootstrap Bootstrap related issues and pull requests label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/bootstrap Bootstrap related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flux fails to bootstrap a repo in a different Windows drive than the one in $env:TEMP

3 participants