kubeopencode icon indicating copy to clipboard operation
kubeopencode copied to clipboard

chore: unify image tag strategy for local-dev (controller :latest vs agent :dev)

Open xuezhaojun opened this issue 7 months ago • 0 comments

Summary

In local-dev (Kind), the controller image uses :latest while agent images use :dev. This inconsistency adds cognitive overhead and is a source of confusion. Ideally all locally-built images should use the same tag convention.

Current State

Context Controller/Server tag Agent tags Notes
local-dev (Kind) :latest :dev Mixed
E2E (Kind) :dev :dev Consistent, but also loads extra :latest copy
CI (push to main) :latest + :sha :latest + :sha Consistent
Go constants :latest :latest Consistent

Why It's Not a Simple Fix

The controller hardcodes :latest in Go constants (pod_builder.go):

DefaultKubeOpenCodeImage = "ghcr.io/kubeopencode/kubeopencode:latest"
DefaultAgentImage        = "ghcr.io/kubeopencode/kubeopencode-agent-opencode:latest"
DefaultExecutorImage     = "ghcr.io/kubeopencode/kubeopencode-agent-devbox:latest"
DefaultAttachImage       = "ghcr.io/kubeopencode/kubeopencode-agent-attach:latest"

These are used for init containers (git-init, context-init, etc.) and as fallback defaults for Agent/AgentTemplate specs. The inferImagePullPolicy() function returns PullAlways for :latest tags, which fails in Kind (no registry access).

The current local-dev workaround is imagePullPolicy=Never via Helm, but the controller image must still exist as :latest in Kind because the Go code references it by that tag.

To unify on :dev for local-dev, the following changes would be needed:

  1. Make DefaultKubeOpenCodeImage and other Go constants configurable (e.g., via KubeOpenCodeConfig.spec.systemImage or build-time ldflags)
  2. Update local-dev-setup / local-dev-reload Makefile targets to load controller as :dev
  3. Ensure Helm sets the system image tag override for Kind deployments
  4. Update E2E to remove the extra :latest loading workaround

Proposed Approach

Use KubeOpenCodeConfig.spec.systemImage.image to override DefaultKubeOpenCodeImage in local-dev, and load all images as :dev uniformly.

Origin

Raised by @jesusvico in https://github.com/kubeopencode/kubeopencode/pull/185#issuecomment-4367419553

xuezhaojun avatar May 04 '26 02:05 xuezhaojun