H2, H8 (H-A-735): the owner pass at the engine's start stops and starts the module's units; composition-diff keeps the entry's name, the words go to the journal
Builds: design 47 H2 H-A-641, H-A-701, H-A-710 (4), H-A-735
This commit is contained in:
@@ -6,7 +6,9 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"slices"
|
||||
"sync"
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/go/clients/nodeengineclient"
|
||||
"git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
|
||||
@@ -409,6 +411,11 @@ func (a *Agent) CompositionDiff(ctx context.Context, module string, revision int
|
||||
// fingerprintLeft says what a container's difference of its env MESH_FINGERPRINT is (design 47 H2, H-A-710 (4)).
|
||||
const fingerprintLeft = "left from before H2, taken out at the container's next recreate"
|
||||
|
||||
// fingerprintLeftSaid is each container whose difference was said, once per node-engine process; journalLine says a line
|
||||
// in the node-engine's journal (its standard error), a variable so a test reads it.
|
||||
var fingerprintLeftSaid sync.Map
|
||||
var journalLine = func(line string) { fmt.Fprintf(os.Stderr, "mesh-host: %s\n", line) }
|
||||
|
||||
// DiffResources is, per resource by its id, the entries that differ from running to other (design 47 H2 §813 (3)): each
|
||||
// top-level field by its name, the environment's entries each by `env.<name>`, and a value the declaration keeps secret
|
||||
// (a file's sealed, vault-sealed or secrets, and the content of a file that has any of them) masked. Resources in id
|
||||
@@ -442,7 +449,10 @@ func DiffResources(running, other []json.RawMessage) []nodeengine.CompositionDif
|
||||
e := nodeengine.CompositionDiffEntry{Name: name}
|
||||
if name == "env."+engcomp.FingerprintVar && (w.values["type"] == string(declaration.TypeContainer) || n.values["type"] == string(declaration.TypeContainer)) {
|
||||
// A container is handed none since H2 (H-A-710 (4)): what a composition from before holds is no change to make.
|
||||
e.Name = name + " (" + fingerprintLeft + ")"
|
||||
// The entry keeps its name; the words are the verb's description and one journal line per container and process.
|
||||
if _, said := fingerprintLeftSaid.LoadOrStore(id, true); !said {
|
||||
journalLine(fmt.Sprintf("%s: %s: %s", id, name, fingerprintLeft))
|
||||
}
|
||||
}
|
||||
if w.secret[name] || n.secret[name] {
|
||||
e.Masked = true
|
||||
|
||||
Reference in New Issue
Block a user