Skip to content

feat(mpg): add fly mpg fork - #5305

Merged
gargakshit merged 2 commits into
masterfrom
akshit/mpg-forking-plans
Oct 16, 2026
Merged

gargakshit merged 2 commits into
masterfrom
akshit/mpg-forking-plans

Conversation

@gargakshit

Copy link
Copy Markdown
Member

Change Summary

What and Why:

Adds fly mpg fork [CLUSTER_ID]. It forks a Managed Postgres cluster into a new cluster from the source's current data. The source cluster isn't changed.

  • --name/-n defaults to <source-name>-fork.
  • --plan is optional. Without it, the fork keeps the source cluster's plan. The API is the source of truth for plans, so the value is passed through as is.
  • v1 clusters are rejected with "forking is not supported for this cluster".

How:

  • Calls the Machines API (POST /v1/postgres/{id}/fork) through the fly-go flaps client, the same way the other v2 mpg commands do.
  • Bumps fly-go to v0.11.5, which adds ForkManagedPostgresCluster and ListManagedPostgresPlans. Both are added to the FlapsClient interface and its mocks/inmem implementations.
  • Tests are in internal/command/mpg/fork_test.go and internal/command/mpg/v2/run_fork_test.go.

Related to:


Documentation

  • Fresh Produce
  • In superfly/docs, or asked for help from docs team
  • n/a

🤖 Generated with Claude Code

gargakshit and others added 2 commits October 15, 2026 13:06
- Fork a v2 Managed Postgres cluster into a new cluster through the
  Machines API (POST /v1/postgres/{id}/fork)
- --name defaults to <source-name>-fork; --plan is optional and, when
  left out, the fork keeps the source cluster's plan
- Add ForkManagedPostgresCluster and ListManagedPostgresPlans to the
  FlapsClient interface and its mocks

Needs a fly-go release with superfly/fly-go#322.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gargakshit
gargakshit merged commit 19b6f4c into master Oct 16, 2026
23 checks passed
@gargakshit
gargakshit deleted the akshit/mpg-forking-plans branch October 16, 2026 03:48
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.

2 participants