Give a service's held state its own field and key, so main compiles again
#64/#65 and #66 each added Applied.Declared: a directory's declared owner and
mode (string) and a service's held state (*FoundUnit), both under the JSON key
"declared". The directory's is already on nodes, written by d28ca95, so it
keeps the name and key; the service's becomes DeclaredUnit, "declared_unit".
#66 never deployed, so no node holds a record under the new key.
This commit is contained in:
@@ -125,14 +125,14 @@ func Plan(d *declaration.Declaration, known store.State, origin string) []Step {
|
||||
case f == nil:
|
||||
step.Verb, step.Why = "forget", "no longer declared; recorded before the host kept what it "+
|
||||
"found, so it is left as it is"
|
||||
case orphan.Declared != nil && ((f.State == "running" && orphan.Declared.State == "stopped") ||
|
||||
(f.Boot == "enabled" && orphan.Declared.Boot == "disabled")):
|
||||
case orphan.DeclaredUnit != nil && ((f.State == "running" && orphan.DeclaredUnit.State == "stopped") ||
|
||||
(f.Boot == "enabled" && orphan.DeclaredUnit.Boot == "disabled")):
|
||||
// startUnitBack's words (novox/hq ADR 0269): what the mesh's declaration stopped goes back.
|
||||
var back []string
|
||||
if f.State == "running" && orphan.Declared.State == "stopped" {
|
||||
if f.State == "running" && orphan.DeclaredUnit.State == "stopped" {
|
||||
back = append(back, "started")
|
||||
}
|
||||
if f.Boot == "enabled" && orphan.Declared.Boot == "disabled" {
|
||||
if f.Boot == "enabled" && orphan.DeclaredUnit.Boot == "disabled" {
|
||||
back = append(back, "enabled at boot")
|
||||
}
|
||||
// A preview: whether it is still as the mesh held it is read when the removal runs, and a
|
||||
|
||||
Reference in New Issue
Block a user