agent: the parts check counts the templates archives a composition was rendered from as fetched (A-481, A-481a)

compose fills Composed.Templates from the resolved manifest's TemplatesDigest; partsDifference adds them to the digests fetched.

Builds: design 47 G A-481, A-481a
This commit is contained in:
2026-11-17 23:44:15 +01:00
parent 179a4a6402
commit 87cfae48b2
7 changed files with 45 additions and 11 deletions
+4 -2
View File
@@ -40,6 +40,8 @@ type Composed struct {
Own NodeOwn
Plan *catalogue.Plan
Refused string
// Templates are the digests of the templates archives the module's files were rendered from, sorted (A-481a).
Templates []string
}
// Bucket constants of a node's compositions (the state composed is one bucket per node).
@@ -65,7 +67,7 @@ func BucketFor(node string) (string, error) {
func toClient(c Composed) (nodeengineclient.Composition, error) {
out := nodeengineclient.Composition{V: c.V, Node: c.Node, Module: c.Module, FP: c.FP, Data: c.Data,
Resources: c.Resources, Filled: c.Filled, Refused: c.Refused}
Resources: c.Resources, Filled: c.Filled, Refused: c.Refused, Templates: c.Templates}
raw, err := json.Marshal(c.Own)
if err != nil {
return out, err
@@ -83,7 +85,7 @@ func toClient(c Composed) (nodeengineclient.Composition, error) {
func fromClient(c nodeengineclient.Composition) (Composed, error) {
out := Composed{V: c.V, Node: c.Node, Module: c.Module, FP: c.FP, Data: c.Data, Resources: c.Resources,
Filled: c.Filled, Refused: c.Refused}
Filled: c.Filled, Refused: c.Refused, Templates: c.Templates}
raw, err := json.Marshal(c.Own)
if err != nil {
return out, err
@@ -150,6 +150,8 @@ func compareOne(module string, composed, running Composed, sameValue func(a, b s
switch {
case !jsonEqual(a.Filled, b.Filled):
return differs("", "the files the provisioner fills differ")
case !jsonEqual(a.Templates, b.Templates):
return differs("", "the templates archives it was rendered from differ")
case a.Data != b.Data:
return differs("", "whether it declares data differs")
case !jsonEqual(a.Own, b.Own):