Skip to content

Comments

Fix bootstrap failure on Windows cross-drive paths#5726

Open
veeceey wants to merge 1 commit intofluxcd:mainfrom
veeceey:fix/issue-1153-windows-cross-drive-bootstrap
Open

Fix bootstrap failure on Windows cross-drive paths#5726
veeceey wants to merge 1 commit intofluxcd:mainfrom
veeceey:fix/issue-1153-windows-cross-drive-bootstrap

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 23, 2026

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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

1 participant