replicatedhq / troubleshoot

Preflight Checks and Support Bundles Framework for Kubernetes Applications
https://troubleshoot.sh
Apache License 2.0
545 stars 94 forks source link

Support bundle redaction fails on Windows #1607

Open manderson23 opened 2 months ago

manderson23 commented 2 months ago

Bug Description

Running the support-bundle executable on Windows with redaction (either when collecting the bundle or running against an existing bundle) fails will an error saying a file is in use.

Expected Behavior

support-bundle with redaction should succeed with no errors on Windows.

Steps To Reproduce

Run support-bundle.exe ./support-bundle.yaml gives error

Error: failed to run collect and analyze process: failed to run collectors: failed to redact in cluster collector results: failed to create redacted result: failed to rename tmp file: rename C:\Users\212534~1\AppData\Local\Temp\replace-22978352 C:\Users\212534~1\AppData\Local\Temp\supportbundle458253607\support-bundle-2024-09-04T10_29_56\cluster-resources\jobs\simulation-worker.json: The process cannot access the file because it is being used by another process.

Run support-bundle.exe redact redactor.yaml --bundle support-bundle-2024-09-04T09_12_48.tar.gz gives error

Error: failed to redact support bundle: failed to create redacted result: failed to rename tmp file: rename C:\Users\212534~1\AppData\Local\Temp\replace-603473377 C:\Users\212534~1\AppData\Local\Temp\troubleshoot-k8s1501536515\support-bundle-2024-09-04T09_12_48\cluster-resources\limitranges\default.json: The process cannot access the file because it is being used by another process.

Additional Context

Windows 10 - same error in git bash, command or powershell

xavpaice commented 1 week ago

Hi, thanks for the report.

Please try this with WSL, which is more like the environment we test on. At this stage we do not have testing environments for Windows and consider Windows unsupported.