Skip to content

fix: persist machine config.mounts (#59)#60

Merged
lex00 merged 1 commit into
mainfrom
feature/59-machine-mounts
Jul 14, 2026
Merged

fix: persist machine config.mounts (#59)#60
lex00 merged 1 commit into
mainfrom
feature/59-machine-mounts

Conversation

@lex00

@lex00 lex00 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Closes #59.

MachineConfig had no mounts field, so a create body's config.mounts were dropped on JSON unmarshal and GET .../machines returned config.mounts: null. chant's flyApply compares desired vs live config, so a mounting machine looked drifted on every reconcile and never no-op'd (surfaced building INTENTIUS/chant#868).

Fix

  • Add a MachineMount type mirroring fly-go's shape (volume, path, name, size_gb, …) and a Mounts []MachineMount field on MachineConfig.
  • Clone Mounts in cloneMachine so returned copies never alias stored state.
  • Store test: a mount survives create → GET, and the returned clone is isolated.

go build/vet/test/gofmt clean.

Once released (0.4.1), chant bumps MUDFLAPS_IMAGE and the fly-reconcile tutorial (#868) gains a volume + mount with a clean offline no-op.

…#59)

MachineConfig had no mounts field, so a create body's config.mounts were dropped
on JSON unmarshal and GET .../machines returned config.mounts: null. A chant
flyApply reconcile compares desired vs live config, so a mounting machine looked
drifted on every apply and never no-op'd (INTENTIUS/chant#868).

Add a MachineMount type mirroring fly-go's shape + a Mounts field on
MachineConfig, and clone Mounts in cloneMachine so returned copies never alias
stored state. A store test asserts a mount survives create -> GET and clone
isolation. build/vet/test/gofmt clean.
@lex00
lex00 merged commit 810f165 into main Jul 14, 2026
2 checks passed
@lex00
lex00 deleted the feature/59-machine-mounts branch July 14, 2026 04:38
lex00 added a commit to INTENTIUS/chant that referenced this pull request Jul 14, 2026
…s mounts (#868, #59)

mudflaps 0.4.1 (INTENTIUS/mudflaps#60) persists machine config.mounts, so a
mounting machine no-ops on re-apply. Enrich the reconcile example/tutorial:

- bump SPRITZER... no: bump MUDFLAPS_IMAGE to 0.4.1.
- add a Volume + a web mount back to fly-reconcile/src/infra.ts; the compile test
  asserts the volume create body + web's mount.
- tutorial + README show the volume in create/no-op output and the image 0.4.1.

Verified end-to-end against ghcr.io/intentius/mudflaps:0.4.1: create (app +
volume + web + worker) → re-apply is a clean no-op for ALL resources, including
the mounted web (previously it re-applied forever). Docs build clean; compile
tests pass.
lex00 added a commit to INTENTIUS/chant that referenced this pull request Jul 14, 2026
…872)

* docs: Reconcile Fly Machines tutorial + fly-reconcile example (#868)

Adds examples/fly-reconcile — one app + two machines whose op reconciles against
a *running* mudflaps (Build → Apply only, no boot/teardown), so re-runs show the
stateless reconcile flyApply does: create → no-op → in-place update → owned-only
prune, with a machine created outside chant surviving the prune (no managed-by
marker). Plus tutorials/fly-machines-reconcile.mdx and a compile test.

Registered in the Fly tutorials sidebar group after local-fly.

Scope note: the example is machines-only. Adding a Volume with a mount hits a
mudflaps fidelity gap — a mounted machine reads back config.mounts=null, so it
perpetually re-applies against the emulator (INTENTIUS/mudflaps#59). The
volume+mount enrichment is deferred to that fix; machines alone give a clean
offline no-op.

Verified: docs build clean; the full reconcile sequence (create/no-op/update/
prune/foreign-survives) runs green against ghcr.io/intentius/mudflaps:0.4.0;
examples compile tests pass.

* fly-reconcile: add the volume + mount now that mudflaps 0.4.1 persists mounts (#868, #59)

mudflaps 0.4.1 (INTENTIUS/mudflaps#60) persists machine config.mounts, so a
mounting machine no-ops on re-apply. Enrich the reconcile example/tutorial:

- bump SPRITZER... no: bump MUDFLAPS_IMAGE to 0.4.1.
- add a Volume + a web mount back to fly-reconcile/src/infra.ts; the compile test
  asserts the volume create body + web's mount.
- tutorial + README show the volume in create/no-op output and the image 0.4.1.

Verified end-to-end against ghcr.io/intentius/mudflaps:0.4.1: create (app +
volume + web + worker) → re-apply is a clean no-op for ALL resources, including
the mounted web (previously it re-applied forever). Docs build clean; compile
tests pass.
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.

Machine config.mounts not persisted — mounted machine perpetually re-applies

1 participant