Skip to content

Add dev-image and dev-push Make targets#12145

Open
caseydavenport wants to merge 2 commits intoprojectcalico:masterfrom
caseydavenport:casey-dev-image-targets
Open

Add dev-image and dev-push Make targets#12145
caseydavenport wants to merge 2 commits intoprojectcalico:masterfrom
caseydavenport:casey-dev-image-targets

Conversation

@caseydavenport
Copy link
Member

Add workflow for building all Calico images, tagging them with a custom tag, and pushing to a personal Docker Hub registry. This enables deploying custom builds on real clusters without kind-specific hacks like PullNever.

The operator is built with registry and imagePath baked in via gen-versions, so it resolves images correctly without Installation CR changes.

Usage:

make dev-push DEV_IMAGE_PATH=caseydavenport DEV_IMAGE_TAG=my-feature

Add workflow for building all Calico images, tagging them with a custom
tag, and pushing to a personal Docker Hub registry. This enables deploying
custom builds on real clusters without kind-specific hacks like PullNever.

The operator is built with registry and imagePath baked in via gen-versions,
so it resolves images correctly without Installation CR changes.

Usage:
  make dev-push DEV_IMAGE_PATH=caseydavenport DEV_IMAGE_TAG=my-feature
@caseydavenport caseydavenport requested a review from a team as a code owner March 16, 2026 19:06
Copilot AI review requested due to automatic review settings March 16, 2026 19:06
@caseydavenport caseydavenport added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Mar 16, 2026
@marvin-tigera marvin-tigera added this to the Calico v3.32.0 milestone Mar 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a developer workflow to build Calico component images locally, retag them with a custom tag/namespace, and (optionally) push them to a personal registry so real clusters can pull custom builds without kind-specific PullNever behavior. It also extends the kind operator build script to generate operator image references pointing at that dev registry/path/tag.

Changes:

  • Add dev-image and dev-push targets to build/tag/push images for a developer-owned registry namespace.
  • Extend hack/test/kind/infra/build-operator.sh with a “dev mode” that regenerates operator versions with custom registry/path/tag.
  • Stop tracking hack/test/kind/infra/operator as a repo object and ignore it to allow local cloning during operator builds.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

File Description
lib.Makefile Adds dev-image/dev-push targets that retag kind-built images for developer publishing.
hack/test/kind/infra/build-operator.sh Adds a dev-mode path that rewrites versions YAML and builds/tags operator for remote pulls.
hack/test/kind/infra/operator Removes previously tracked operator directory reference (was preventing clean local cloning).
.gitignore Ignores hack/test/kind/infra/operator so local clones don’t show up as untracked.

Skip work for unchanged images using docker image ID comparison via
stamp files in .dev-stamps/:

- dev-image: only re-tags images whose docker ID changed since last run
- dev-image-operator: only rebuilds when inputs change (versions file,
  tag, registry, path, operator branch). This is the big win since the
  operator build clones and compiles from scratch.
- dev-push: only pushes images whose ID changed since last push

Also set PullAlways in dev mode operator builds so clusters pull fresh
images when redeploying with the same tag.

Use 'rm -rf .dev-stamps' to force a full rebuild.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants