Let the judgement beside a composition say unchanged: equal to the declaration the node last applied (issue 1943; ADR 0540 clause 9)
The first want at the switch skips the record hold only where the composition changes nothing on the node.
This commit is contained in:
@@ -120,6 +120,10 @@ const (
|
||||
JudgedNeither Judgement = "neither"
|
||||
// JudgedCannot is a move that cannot be judged, because the composition the node runs is gone or cannot be read.
|
||||
JudgedCannot Judgement = "cannot-judge"
|
||||
// JudgedUnchanged is a composition equal to the module's slice of the declaration the node last applied, for a node
|
||||
// whose have names no composition yet (the first want at the switch, novox/hq ADR 0540 clause 9): applying it
|
||||
// changes nothing on the node, so it needs no person's yes.
|
||||
JudgedUnchanged Judgement = "unchanged"
|
||||
)
|
||||
|
||||
var digestForm = regexp.MustCompile(`^sha256:[0-9a-f]{64}$`)
|
||||
@@ -187,14 +191,14 @@ func (c ComposedDigest) check() error {
|
||||
if c.Against == "" {
|
||||
return fmt.Errorf("delivery: a move judged %s names the composition it is judged against", c.Judgement)
|
||||
}
|
||||
case JudgedNeither:
|
||||
case JudgedNeither, JudgedUnchanged:
|
||||
case JudgedCannot:
|
||||
if c.Words == "" {
|
||||
return fmt.Errorf("delivery: a move that cannot be judged says why")
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("delivery: the judgement %q is not %s, %s, %s or %s", c.Judgement, JudgedRecreates,
|
||||
JudgedMovesData, JudgedNeither, JudgedCannot)
|
||||
return fmt.Errorf("delivery: the judgement %q is not %s, %s, %s, %s or %s", c.Judgement, JudgedRecreates,
|
||||
JudgedMovesData, JudgedNeither, JudgedCannot, JudgedUnchanged)
|
||||
}
|
||||
if c.Policy != "" || c.PolicyFrom != "" {
|
||||
if !oneOf(c.Policy, composedPolicies) {
|
||||
|
||||
@@ -80,6 +80,7 @@ func TestComposedDigestValue(t *testing.T) {
|
||||
{Digest: digest, Judgement: JudgedRecreates, Against: against, Words: "the container's image changes"},
|
||||
{Digest: digest, Judgement: JudgedMovesData, Against: against},
|
||||
{Digest: digest, Judgement: JudgedCannot, Words: "the composition the node runs is gone"},
|
||||
{Digest: digest, Judgement: JudgedUnchanged, Words: "equal to the declaration the node last applied"},
|
||||
{Digest: digest, Judgement: JudgedNeither, Policy: "record", PolicyFrom: "person", PolicyWhy: "the operator: its data"},
|
||||
{Digest: digest, Judgement: JudgedNeither, Policy: "roll", PolicyFrom: "default"},
|
||||
{Digest: digest, Judgement: JudgedNeither, Against: against, UserListOnly: true, Words: "only the bus's user list changes"},
|
||||
|
||||
Reference in New Issue
Block a user