Repository navigation
Declarative service state: stopped / running (closes #100) - #101
Merged
Merged
Conversation
A service manifest may declare state: stopped or state: running (absent = today's behaviour, unchanged). - plan: stopped + running container -> one stop-service item; running + stopped container -> one start-service item. - apply: stop in place (never delete, volumes/route kept); start before converging; fresh stopped containers stop after create (health/route/post-deploy deferred to the starting deploy). - load refuses any other state value. - absent state is omitted from plan JSON, so existing plan hashes are unchanged (golden suites green).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft PR: declarative service state (
state: stopped/state: running)What
A service manifest may now declare whether its container runs:
stoppedon a running container yields exactly onestop-serviceitem;runningon a stopped container yields onestart-serviceitem. Absent state plans nothing new.deleted, its volumes are never touched, nothing is purged, and the route
stays as it is (a stopped service answers whatever the edge returns for
a dead backend). A fresh container that declares
stoppedis stopped atthe end of its first deploy (health, route and post-deploy run on the
deploy that starts it). An explicit
runningstarts a stopped containerbefore the rest is converged.
state:value is refused with the manifest path.state:is omitted from the plan JSON, so manifestswithout it hash exactly as before (existing golden suites unchanged).
MCP needs no schema change: the stop/start items render in the plan text
that
get_planalready returns. README services reference documents thefield.
Why
Some services must be stopped without being forgotten: removing a manifest
cannot stop anything (a plan only creates, replaces, attaches, sets
limits/labels/env, restarts, publishes routes or runs hooks), while
deleting the container by hand is invisible to GitOps and the next deploy
recreates it.
state: stoppedmakes the stop declarative, reviewable, andreversible (
runningor removing the field starts it again).Verification
Test-first, mirroring the existing
hostSimharness (extended withincus start):go test ./pkg/... ./cmd/...green (includes the golden plan-hash suites),go vetandgofmtclean.References
stop-state.patch(format-patch against v1.76.0, single commit)