Build HO Image

Builds and pushes hypershift-operator container images for testing changes on live clusters.

538|560|Updated Jan 18, 2021
One-click install
npx skills add https://github.com/openshift/hypershift --skill build-ho-image
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Build HO Image
Source: https://github.com/openshift/hypershift/tree/main/.claude/skills/dev/build-ho-image
Command: npx skills add https://github.com/openshift/hypershift --skill build-ho-image

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing changes to the hypershift-operator requires deploying a custom-built container image to a live cluster, and manually managing tags, builds, and pushes across iterations is repetitive and error-prone.

Core Features & Use Cases

  • Custom Image Builds: Builds the hypershift-operator image from the main Dockerfile, including the hypershift CLI, hypershift-operator, karpenter-operator, and hcp binaries.
  • Tagging Strategies: Generates unique image tags from branch names, commit hashes, or descriptive iteration labels.
  • Iteration Workflow: Supports a tight loop of code change, image build/push, HyperShift reinstall, and e2e validation.
  • Use Case: After modifying code in hypershift-operator/, build and push an image tagged fix-1, reinstall HyperShift with it, run e2e tests, and repeat with incremented tags until tests pass.

Quick Start

Build and push a hypershift-operator image tagged with my current branch name so I can test my operator changes on a live cluster.

Frequently Asked Questions about Build HO Image

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build and push a hypershift-operator image?

Source dev/claude-env.sh, then run the container runtime build with the main Dockerfile targeting linux/amd64 and tag it with your registry repo. Push the image with the same runtime, or use the provided one-liner to build and push in a single command.

What tag should I use for hypershift-operator image iterations?

Use your branch name, short commit hash, or a descriptive name with an incrementing number like fix-1, fix-2, fix-3. Incremented tags make it easy to track which build is deployed during repeated test cycles.

Does the HO image build work with both podman and docker?

Yes, the RUNTIME environment variable from dev/claude-env.sh selects the container runtime, so both podman and docker are supported. The same build and push commands work with either tool.

Why is my hypershift-operator image build failing?

Builds commonly fail due to outdated vendored dependencies or code that does not compile locally. Run go mod vendor, verify compilation with make hypershift-operator, and check API generation with make api before rebuilding.

Why are my operator changes not reflected after deploying the new image?

Stale pods may still run the old image if the tag was reused or the rollout did not trigger. Verify the correct tag, check running pods in the hypershift namespace, and force a rollout restart of the operator deployment.