Say in the plan that a unit is restored only if it is still as the mesh held it
mesh/merge-gate pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery failed: its walk failed: a gate on a first machine (what it carried put back), a build, a machine
mesh/merge-gate pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery failed: its walk failed: a gate on a first machine (what it carried put back), a build, a machine
Confirmation pass of #66: the plan is a preview, and the removal reads the unit when it runs; a masked unit or one changed since is left as it is.
This commit is contained in:
@@ -97,7 +97,8 @@ func TestThePlanSaysAStoppedUnitIsStartedAgain(t *testing.T) {
|
||||
said = s.Verb + ": " + s.Why
|
||||
}
|
||||
}
|
||||
if !strings.HasPrefix(said, "restore: ") || !strings.Contains(said, "started and enabled at boot again") {
|
||||
if !strings.HasPrefix(said, "restore: ") || !strings.Contains(said, "restore if still as the mesh held it") ||
|
||||
strings.Contains(said, "so it is started") {
|
||||
t.Errorf("the plan says %q", said)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,8 +135,10 @@ func Plan(d *declaration.Declaration, known store.State, origin string) []Step {
|
||||
if f.Boot == "enabled" && orphan.Declared.Boot == "disabled" {
|
||||
back = append(back, "enabled at boot")
|
||||
}
|
||||
step.Verb, step.Why = "restore", "no longer declared; the host found it running and enabled and "+
|
||||
"the mesh held it stopped, so it is "+strings.Join(back, " and ")+" again"
|
||||
// A preview: whether it is still as the mesh held it is read when the removal runs, and a
|
||||
// masked unit or one changed since is left as it is.
|
||||
step.Verb, step.Why = "restore", "no longer declared; restore if still as the mesh held it: "+
|
||||
strings.Join(back, " and ")+" again, as the host found it, unless it is masked or was changed since"
|
||||
case f.State == "stopped" || f.Boot == "disabled":
|
||||
var back []string
|
||||
if f.State == "stopped" {
|
||||
|
||||
Reference in New Issue
Block a user