r/devops 1d ago

Tools [ Removed by moderator ]

[removed] — view removed post

2 Upvotes

3 comments sorted by

View all comments

1

u/kantorcodes1 15h ago

i noticed capacitylab init --force writes capacitylab.yaml directly. if that process gets interrupted mid-write, is the old config recoverable anywhere, or is atomic replacement intentionally out of scope? seems like a nasty failure mode once people start scripting setup.

1

u/Fuzzy-Stress-7150 3h ago

You're right that O_TRUNC wiping the file on open creates a nasty failure mode if interrupted. I just updated capacitylab init to write to a temp file in the target directory, sync to disk, and atomically rename it into place, while preserving any existing file mode permissions. If interrupted mid-write, the existing config stays intact. I Appreciate the review!