Build, image, node, distribution and gitea take parts, buildstep and composer from mesh-delivery-sdk; seatgen's client check allows a client's own packages and its -go-module has no root default; the build module writes its finding through the conditions client (K-4..K-20 part; ADR 0634 §3, §4, ADR 0635 §4; issue 1966)
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
sdkstep "git.novox.be/novox/mesh-sdk/go/buildstep"
|
||||
sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -513,7 +513,7 @@ func (p *Puller) next(ctx context.Context, wait time.Duration) (*Pulled, error)
|
||||
// message: the asker puts the ask again under a new id (issue 890). A message whose decline cannot be written is handed
|
||||
// back, as one whose start cannot be.
|
||||
func (p *Puller) decline(msg *Pulled, ask delivery.StepAsk, lacks []string) {
|
||||
step, key, err := begin(p.Put, p.Node, ask.Kind+" ask", ask.ID, sdkstep.AskWhat(ask))
|
||||
step, key, err := begin(p.Put, p.Node, ask.Kind+" ask", ask.ID, sdkstep.AskWhat(askRead(ask)))
|
||||
if err == nil {
|
||||
why := Refuse("the ask %s needs %s, and %s lacks %s: it is left to a node that has it", ask.ID,
|
||||
strings.Join(ask.Needs, ", "), p.Node, strings.Join(lacks, ", "))
|
||||
@@ -585,7 +585,7 @@ func (p *Puller) take(ctx context.Context, msg *Pulled) {
|
||||
p.decline(msg, ask, lacks)
|
||||
return
|
||||
}
|
||||
step, key, err := begin(p.Put, p.Node, ask.Kind+" ask", ask.ID, sdkstep.AskWhat(ask))
|
||||
step, key, err := begin(p.Put, p.Node, ask.Kind+" ask", ask.ID, sdkstep.AskWhat(askRead(ask)))
|
||||
if err != nil {
|
||||
p.logf("the ask %s cannot start on %s: %v", ask.ID, p.Node, err)
|
||||
_ = msg.Nak()
|
||||
@@ -797,3 +797,13 @@ func (p *Puller) capacityFrom(c stdio.ProvisionChange) (int, string) {
|
||||
}
|
||||
return n, ""
|
||||
}
|
||||
|
||||
// askRead is the part of an ask that mesh-delivery-sdk's AskWhat reads, taken from the ask's own layout (the part
|
||||
// build-step's StepAsk is the same JSON).
|
||||
func askRead(ask delivery.StepAsk) sdkstep.Ask {
|
||||
var out sdkstep.Ask
|
||||
if raw, err := json.Marshal(ask); err == nil {
|
||||
_ = json.Unmarshal(raw, &out)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user