Skip to content

Conversation

@htoyoda18
Copy link
Contributor

@htoyoda18 htoyoda18 commented Dec 29, 2025

What I did

This PR fixes the temporary file handling in the bridge package during
the compose convert process.

Previously, the convert function used a fixed path in the system temporary
directory via os.TempDir(), which caused the following issues:

  • Temporary compose.yaml files were not removed after execution
  • Multiple runs could overwrite the same file
  • Concurrent executions could lead to race conditions
  • Sensitive project data could remain on disk unexpectedly

This change replaces the shared temp directory usage with
os.MkdirTemp, creating an isolated temporary directory per execution
and ensuring proper cleanup with defer os.RemoveAll.


Related issue

fixes #13482


(not mandatory) A picture of a cute animal, if possible in relation to what you did

image

Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
@htoyoda18 htoyoda18 force-pushed the fix/bridge-convert-temp-cleanup branch from 89d2d8b to 545035f Compare December 29, 2025 17:38
@htoyoda18 htoyoda18 marked this pull request as ready for review December 29, 2025 17:44
@htoyoda18 htoyoda18 requested a review from a team as a code owner December 29, 2025 17:44
@htoyoda18 htoyoda18 requested review from glours and ndeloof December 29, 2025 17:44
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.

[BUG] Temporary file leak and race condition in "bridge convert"

1 participant