diff --git a/internal/apply/giveback_test.go b/internal/apply/giveback_test.go index 2e64401..94c5a52 100644 --- a/internal/apply/giveback_test.go +++ b/internal/apply/giveback_test.go @@ -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) } } diff --git a/internal/apply/plan.go b/internal/apply/plan.go index fba1bfa..e355737 100644 --- a/internal/apply/plan.go +++ b/internal/apply/plan.go @@ -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" {