Skip to content

fix deleting failed deployments#374

Open
peterj wants to merge 2 commits intomainfrom
peterj/fix-undeploy-empty-compose
Open

fix deleting failed deployments#374
peterj wants to merge 2 commits intomainfrom
peterj/fix-undeploy-empty-compose

Conversation

@peterj
Copy link
Contributor

@peterj peterj commented Mar 18, 2026

Description

UndeployDeployment calls adapter.Undeploy() first, and only deletes the DB record if that succeeds. The adapter's undeploy strategy is to remove the deployment's services from the compose file, then run docker compose up -d --remove-orphans to reconcile the running state. When the deleted deployment was the last (or only) service, the compose file ends up with zero services, and docker compose up fails with "no service selected". This error propagates all the way up, so the DB record is never deleted — leaving a zombie deployment that can never be removed.

fixes #371

Change Type

/kind fix

Changelog

fixes deleting zombie'd deployments

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Copilot AI review requested due to automatic review settings March 18, 2026 21:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes local platform undeploy behavior when removing the final service would leave a Compose project with no services (avoiding docker compose up failures that prevent deletion of failed/zombie deployments).

Changes:

  • Add docker compose down support for the local platform runtime.
  • Switch local undeploy/apply flows to call compose down when the composed services set becomes empty.
  • Add a regression test covering the “no services remain” undeploy path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
internal/registry/platforms/local/deployment_adapter_local_platform.go Adds ComposeDownLocalPlatform() helper to stop/remove the local compose runtime.
internal/registry/platforms/local/deployment_adapter_local.go Calls compose down instead of up when the resulting compose service set is empty.
internal/registry/platforms/local/deployment_adapter_local_test.go Adds test to ensure undeploy triggers compose down (and not compose up) when no services remain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

can't delete failed deployment

2 participants