fix(builder): use a local node-agent image when it can't be pulled

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gregandClaude Opus 5.5 committed 2026-10-26 00:01:54 -04:00
1 parent 04967a8a16
commit 0dc784dfa2
3 files changed
+18 -4

No files matched your search

+14
View File
@@ -21,6 +21,20 @@ func agentImageFromEnv() string {
return defaultAgentImage
}
// pullAgentImage fetches the latest node-agent image. A copy that is only local (a test build) is used as
// it is.
func pullAgentImage(img string) error {
out, err := runCmd("docker", "pull", "-q", img)
if err == nil {
return nil
}
if _, inspectErr := runCmd("docker", "image", "inspect", img); inspectErr == nil {
fmt.Printf("[agent] could not pull %s (%s); using the local copy\n", img, firstLine(out))
return nil
}
return fmt.Errorf("docker pull %s: %v: %s", img, err, out)
}
// runAgentBootTest deploys a payload with BootTest and returns its output; passed is its verdict.
func runAgentBootTest(payload map[string]any, agentImage string) (output string, passed bool, err error) {
container := fmt.Sprint(payload["containerName"])