Prove every changed health check on a bed before the catalogue merges (hq ADR 0240, to-be 48 Phase D) #56

Merged
mesh-admin merged 2 commits from feat/health-the-bed into main 2026-10-07 16:28:44 +00:00
Showing only changes of commit a1a03f9880 - Show all commits
+14 -4
View File
@@ -75,11 +75,21 @@ func (d *Docker) Pull(ctx context.Context, image string) error {
if err := d.call(ctx, http.MethodGet, "/images/"+url.PathEscape(image)+"/json", nil, nil); err == nil {
return nil
}
name, tag, _ := strings.Cut(image, ":")
if tag == "" {
tag = "latest"
// A digest is the tag the runtime is asked for, as its own client asks: `name@sha256:…` cut at the
// `@`; otherwise the tag after the last `:` that is not part of a registry's port.
name, tag, digested := strings.Cut(image, "@")
if !digested {
name, tag = image, "latest"
if at := strings.LastIndex(image, ":"); at > strings.LastIndex(image, "/") {
name, tag = image[:at], image[at+1:]
}
}
return d.call(ctx, http.MethodPost, "/images/create?fromImage="+url.QueryEscape(name)+"&tag="+url.QueryEscape(tag), nil, nil)
err := d.call(ctx, http.MethodPost, "/images/create?fromImage="+url.QueryEscape(name)+"&tag="+url.QueryEscape(tag), nil, nil)
if err != nil {
return err
}
// The runtime answers a pull it could not make with a stream that ends in an error, not a status.
return d.call(ctx, http.MethodGet, "/images/"+url.PathEscape(image)+"/json", nil, nil)
}
// Network makes a network of its own and answers its id.