Skip to content

fix(daemon): serving the main ports refuses a stack of containers only - #188

Merged
7schmiede merged 1 commit into
mainfrom
fix/main-slot-compose-only
Oct 21, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/main-slot-compose-only

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Part 1 of #184. This does not close the issue, because part 2 needs an ADR first.

Problem

For a stack with Compose containers only, POST /v1/lanes/{lane}/main ("serve main ports") answered 200 and recorded the lane as the main-slot owner, but nothing moved. take_main moves only the fixed ports of [services.*] and their workers. A container's published port is bound by Docker.

Fix

  • moves_main_slot(stack) in supervisor/handover.rs checks whether the stack has anything the slot can move: a service with a port that runs in lanes on this platform (not a job), or one with workers.
  • take_main refuses with 409 when there is nothing to move: "this stack has no services on main ports: Compose containers keep their own ports, so the main slot cannot move them". The dashboard's act shows the message. Giving the slot back (main) is unaffected.
  • docs/stack-file.md, docs/dashboard-api.md and docs/pool.md now say the main ports are the services' fixed ports. CHANGELOG is updated.

Tests

  • New unit tests in handover.rs: a stack with no services, or only one with lanes = false, moves nothing; a service on a port, or one with workers, moves.
  • cargo clippy -p devstack-daemon --all-targets -- -D warnings and cargo fmt pass.

🤖 Generated with Claude Code

`take_main` moves the fixed ports of `[services.*]` and their workers. A
Compose container's published port is Docker's, so for a stack of
containers only it moved nothing, set the owner anyway and answered
`200`. It now refuses with `409` and says why; the dashboard shows it.
The docs say what the main ports are.

Part 1 of #184; moving the containers' ports needs an ADR first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant