Skip to content

fix(create_stemcell): honor TMPDIR for heavy stemcell extraction - #384

Merged
aramprice merged 1 commit into
mainfrom
fix/create-stemcell-honor-tmpdir
Dec 3, 2026
Merged

aramprice merged 1 commit into
mainfrom
fix/create-stemcell-honor-tmpdir

Conversation

@neddp

@neddp neddp commented Nov 24, 2026

Copy link
Copy Markdown
Member

os.MkdirTemp hardcoded "/tmp" as the parent for the unpacked-image directory, ignoring the configured TMPDIR. On systems where /tmp has insufficient space this fails heavy stemcell creation. Passing "" lets os.TempDir() resolve TMPDIR, falling back to /tmp when it is unset so existing deployments are unaffected.

Part 2 of #374.

os.MkdirTemp hardcoded "/tmp" as the parent for the unpacked-image
directory, ignoring the configured TMPDIR. On systems where /tmp has
insufficient space this fails heavy stemcell creation. Passing "" lets
os.TempDir() resolve TMPDIR, falling back to /tmp when it is unset so
existing deployments are unaffected.

Part 2 of #374.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The heavy-stemcell path now creates the unpacked-image temporary directory in the system default temporary directory. Tests check the directory name and verify that a custom TMPDIR determines the path passed to the root image provider.

Suggested reviewers: dudejas, aramprice

Merge Risk: Minimal · up to e533f

Heavy stemcell extraction will now use the configured TMPDIR, falling back to /tmp when it is unset, so existing deployments keep their current behavior. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: create_stemcell now honors TMPDIR for the unpacked-image directory, matching the raw summary (default system temp dir instead of hardcoded /tmp) and the stated objective. I…
Description check Passed The description states the problem (os.MkdirTemp hardcodes /tmp, ignoring TMPDIR), the fix (passing an empty string so os.TempDir() resolves TMPDIR with /tmp fallback), and the compatibility impact. T…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: create_stemcell now honors TMPDIR for the unpacked-image directory, matching the raw summary (default system temp dir instead of hardcoded /tmp) and the stated objective. It is specific and gives the primary change. Conventional-commit prefix is acceptable.

Full details: Description check

Explanation

The description states the problem (os.MkdirTemp hardcodes /tmp, ignoring TMPDIR), the fix (passing an empty string so os.TempDir() resolves TMPDIR with /tmp fallback), and the compatibility impact. This matches the raw summary change in create_stemcell.go and its tests.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b22db73e-3fed-4aae-868f-963dc48d5391
Commits

Reviewing files that changed from the base of the PR and between 4ac5e58 and e533fbb.

Files selected for processing: 2

  • src/openstack_cpi_golang/cpi/methods/create_stemcell.go
  • src/openstack_cpi_golang/cpi/methods/create_stemcell_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the change to honor TMPDIR during heavy stemcell extraction.

No open issues 🎉

What changed in this PR

Updates heavy stemcell extraction to honor TMPDIR, allowing deployments to use a filesystem with sufficient space while preserving the /tmp fallback when unset.

Changes:

  • Uses the default temporary directory instead of hardcoding /tmp.
  • Adds a regression test for TMPDIR and removes the hardcoded parent path from the existing assertion.
File Description
src/​openstack_cpi_golang/​cpi/​methods/​create_stemcell.go Lets os.MkdirTemp select the configured temporary directory.
src/​openstack_cpi_golang/​cpi/​methods/​create_stemcell_test.go Verifies TMPDIR is honored and updates the temporary-path assertion.

Review effort: Balanced

@neddp
neddp marked this pull request as ready for review December 1, 2026 10:09
@aramprice aramprice moved this from Pending Merge | Prioritized to Pending Review | Discussion in Foundational Infrastructure Working Group Dec 2, 2026
@aramprice
aramprice requested review from a team, KauzClay and nouseforaname and removed request for a team December 2, 2026 06:15
@github-project-automation github-project-automation Bot moved this from Pending Review | Discussion to Pending Merge | Prioritized in Foundational Infrastructure Working Group Dec 3, 2026
@aramprice
aramprice merged commit 8b27add into main Dec 3, 2026
9 checks passed
@aramprice
aramprice deleted the fix/create-stemcell-honor-tmpdir branch December 3, 2026 16:12
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants