What a node keeps of a module as it runs, for a manifest that does not yet say it, is carried on the module's have by module, so the watchman raises its condition (ADR 0601 §4; review round 1, finding 3)
This commit is contained in:
@@ -23,9 +23,9 @@ import (
|
||||
// Known by what runs, never by a module's name.
|
||||
|
||||
// keepWhatRuns marks, in in, each module placed on node that what runs shows is the tool runner or carries the core's
|
||||
// credentials, where its manifest does not say so; it returns, sorted, what it marked, in words. The tool runner is marked
|
||||
// only where no placed module's manifest says it is one.
|
||||
func keepWhatRuns(in *compose.Input, node string, running []delivery.Composed) []string {
|
||||
// credentials, where its manifest does not say so; it returns, sorted by module, what it marked, in words. The tool runner is
|
||||
// marked only where no placed module's manifest says it is one.
|
||||
func keepWhatRuns(in *compose.Input, node string, running []delivery.Composed) []KeptAsRuns {
|
||||
placed := assignedOn(*in, node)
|
||||
if len(placed) == 0 || len(running) == 0 {
|
||||
return nil
|
||||
@@ -60,7 +60,7 @@ func keepWhatRuns(in *compose.Input, node string, running []delivery.Composed) [
|
||||
}
|
||||
}
|
||||
}
|
||||
var said []string
|
||||
var said []KeptAsRuns
|
||||
saysRunner := false
|
||||
for _, m := range placed {
|
||||
if man, ok := manifestOn(*in, node, m); ok && catalogue.IsToolRunner(man) {
|
||||
@@ -68,6 +68,7 @@ func keepWhatRuns(in *compose.Input, node string, running []delivery.Composed) [
|
||||
}
|
||||
}
|
||||
mark := func(module string, set func(*catalogue.Manifest), words string) {
|
||||
k := KeptAsRuns{Module: module, Words: words}
|
||||
for i := range in.Nodes {
|
||||
if in.Nodes[i].Name != node {
|
||||
continue
|
||||
@@ -75,14 +76,14 @@ func keepWhatRuns(in *compose.Input, node string, running []delivery.Composed) [
|
||||
if man, ok := in.Nodes[i].Kept[module]; ok {
|
||||
set(&man)
|
||||
in.Nodes[i].Kept[module] = man
|
||||
said = append(said, words)
|
||||
said = append(said, k)
|
||||
return
|
||||
}
|
||||
}
|
||||
if man, ok := in.Catalogue[module]; ok {
|
||||
set(&man)
|
||||
in.Catalogue[module] = man
|
||||
said = append(said, words)
|
||||
said = append(said, k)
|
||||
}
|
||||
}
|
||||
if runner != "" && !saysRunner {
|
||||
@@ -95,6 +96,11 @@ func keepWhatRuns(in *compose.Input, node string, running []delivery.Composed) [
|
||||
"and its manifest does not say they are the core's credentials (core-credentials): they stay sealed, until its manifest says so", m))
|
||||
}
|
||||
}
|
||||
sort.Strings(said)
|
||||
sort.SliceStable(said, func(i, j int) bool { return said[i].Module < said[j].Module })
|
||||
return said
|
||||
}
|
||||
|
||||
// KeptAsRuns is one module composed as what runs shows, and why, in words (ADR 0601 §4): its have carries the words.
|
||||
type KeptAsRuns struct {
|
||||
Module, Words string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user