H-A-150: forget only on the store's own answer, and on the apply's fetch too
A fetch nothing answered for (a bus or store that did not answer, a gateway saying the store is away) proves nothing about the digest, so it is tried again as before and the module is not held for it; only an answer of the store's (a 404, bytes not of the digest) forgets the resolution. The apply's fetch of a bundle meets the same wrong digest as the take-in's, so it tells the composer too (apply.WithFetchFailed, set in the node agent's apply). Builds: design 47 H H-A-150, H-A-146, G A-430a
This commit is contained in:
@@ -75,12 +75,18 @@ func fetchFirst(ctx context.Context, ordered []declaration.Resource, d *declarat
|
||||
if !seen && !kept {
|
||||
got.body, got.err = fetchMinding(ctx, source, in.away)
|
||||
bySource[cacheKey] = got
|
||||
if ff := fetchFailedFrom(ctx); ff != nil && StoreAnswered(got.err) {
|
||||
ff(digest, fmt.Sprintf("the apply's fetch of %s failed: %v", source, got.err)) // H-A-150
|
||||
}
|
||||
}
|
||||
if got.err == nil {
|
||||
sum := sha256.Sum256(got.body)
|
||||
if have := "sha256:" + hex.EncodeToString(sum[:]); have != digest {
|
||||
got = fetchedArtifact{err: fmt.Errorf("%s was declared as %s and what arrived is %s; nothing was unpacked",
|
||||
source, digest, have)}
|
||||
if ff := fetchFailedFrom(ctx); ff != nil && !seen && !kept {
|
||||
ff(digest, "the apply's fetch failed: "+got.err.Error()) // H-A-150
|
||||
}
|
||||
}
|
||||
}
|
||||
if got.err == nil {
|
||||
|
||||
Reference in New Issue
Block a user