Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions internal/openclaw/openclaw.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ func openclawImageTag() string {
return ""
}

// ImageRef returns the pinned OpenClaw image reference used by the local
// binary when it writes overlay values. Empty string means no explicit ref.
func ImageRef() string {
if tag := openclawImageTag(); tag != "" {
return "ghcr.io/obolnetwork/openclaw:" + tag
}
return ""
}

// OnboardOptions contains options for the onboard command
type OnboardOptions struct {
ID string // Deployment ID (empty = generate petname)
Expand Down
22 changes: 22 additions & 0 deletions internal/stack/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,14 @@ var localImages = []localImage{
{tag: "ghcr.io/obolnetwork/x402-buyer:latest", dockerfile: "Dockerfile.x402-buyer"},
}

func devPreloadImages() []string {
var images []string
if ref := openclaw.ImageRef(); ref != "" {
images = append(images, ref)
}
return images
}

// buildAndImportLocalImages builds Docker images from source and imports them
// into the k3d cluster. This ensures images are available even when the GHCR
// publish workflow hasn't run. Non-fatal: logs warnings on failure.
Expand Down Expand Up @@ -736,6 +744,20 @@ func buildAndImportLocalImages(cfg *config.Config) {
fmt.Printf("Warning: failed to import %s into k3d: %v\n", img.tag, err)
}
}

for _, ref := range devPreloadImages() {
fmt.Printf("Preloading %s into cluster %s...\n", ref, clusterName)
pullCmd := exec.Command("docker", "pull", ref)
pullCmd.Stdout = os.Stdout
pullCmd.Stderr = os.Stderr
if err := pullCmd.Run(); err != nil {
fmt.Printf("Warning: failed to pull %s: %v\n", ref, err)
continue
}
if err := importImageToCluster(k3dBinary, clusterName, ref); err != nil {
fmt.Printf("Warning: failed to import %s into k3d: %v\n", ref, err)
}
}
}

func importImageToCluster(k3dBinary, clusterName, tag string) error {
Expand Down