Skip to content
Development
Skill

/build-cpo-image

Build and push control-plane-operator container image. Auto-applies when testing CPO changes that require deploying to a live cluster.

From plugin
hypershift
55122 skills5 agents

Claude Code

$ npx -y skills add openshift/hypershift --skill build-cpo-image --agent claude-code

SKILL.md

build-cpo-image.SKILL.md
name: Build CPO Image
description: "Build and push control-plane-operator container image. Auto-applies when testing CPO changes that require deploying to a live cluster."

Build Control-Plane-Operator Image

This skill enables building and pushing custom control-plane-operator (CPO) images for testing changes in a live HyperShift environment.

When to Use This Skill

This skill automatically applies when:

  • You've made changes to code in `control-plane-operator/`
  • You need to test CPO changes against a live cluster
  • The user asks to build/push a CPO image
  • You need to iterate on CPO fixes with e2e tests

Prerequisites

Source the environment file before using this skill:

source dev/claude-env.sh

Image Registry Configuration

Environment variables from `dev/claude-env.sh`:

| Variable | Description | |----------|-------------| | `CPO_IMAGE_REPO` | Container registry for CPO images | | `RUNTIME` | Container runtime (podman/docker) |

Building the CPO Image

Step 1: Generate a Unique Tag

Use a tag that identifies the change (branch name, feature, or timestamp):

# Option 1: Use branch name
TAG=$(git rev-parse --abbrev-ref HEAD | tr '/' '-')

# Option 2: Use short commit hash
TAG=$(git rev-parse --short HEAD)

# Option 3: Use descriptive name + number for iterations
TAG="feature-name-1"

Step 2: Build the Image

The CPO image uses `Dockerfile.control-plane`:

$RUNTIME build -f Dockerfile.control-plane --platform linux/amd64 -t $CPO_IMAGE_REPO:$TAG .

**Note**: The build runs `make control-plane-operator` and `make control-plane-pki-operator` inside the container, so you don't need to pre-build locally.

Step 3: Push the Image

$RUNTIME push $CPO_IMAGE_REPO:$TAG

Quick One-Liner

Build and push in one command:

TAG="my-fix-1" && $RUNTIME build -f Dockerfile.control-plane --platform linux/amd64 -t $CPO_IMAGE_REPO:$TAG . && $RUNTIME push $CPO_IMAGE_REPO:$TAG

Iteration Workflow

When iterating on CPO fixes:

1. Make code changes in `control-plane-operator/` 2. Build and push image with incremented tag (e.g., `fix-1`, `fix-2`, `fix-3`) 3. Run e2e test with new image 4. Analyze results 5. Repeat until test passes

What Gets Built

The `Dockerfile.control-plane` builds:

  • `control-plane-operator` binary
  • `control-plane-pki-operator` binary

Both are included in the final image.

Image Labels

The CPO image includes important capability labels that HyperShift uses:

  • `io.openshift.hypershift.control-plane-operator-subcommands=true`
  • `io.openshift.hypershift.control-plane-operator.v2-isdefault=true`
  • Various other feature capability labels

Troubleshooting

Build Fails

  • Check that vendored dependencies are up to date: `go mod vendor`
  • Ensure code compiles locally: `make control-plane-operator`

Push Fails

  • Verify registry login: `$RUNTIME login quay.io`
  • Check repository permissions

Image Not Used by Cluster

  • Verify the image tag is correct in e2e flags
  • Check that the image was pushed successfully
  • Ensure the cluster can pull from the registry (public or authenticated)
Read more
@openshift
Ships withhypershift

HyperShift is a middleware for hosting OpenShift control planes at scale that solves for cost and time to provision, as well as portability cross cloud with strong separation of concerns between management and workloads.

55122 skills5 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
551
Star history of openshift/hypershift on GitHub, a chart by star-history.com

Other skills on hypershift.

debug-cluster

debug-cluster

Provides systematic debugging approaches for HyperShift hosted-cluster issues. Auto-applies when debugging cluster problems,…

build-ho-image

build-ho-image

Build and push hypershift-operator container image. Auto-applies when testing HO changes that require deploying to a live cluster.

create-hc-aws

create-hc-aws

Create a HyperShift HostedCluster on AWS for development and testing, with optional custom CPO/HO images.

e2e-run-aws

e2e-run-aws

Provides the ability to run and iterate on HyperShift e2e tests. Auto-applies when implementing features that require e2e…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about build-cpo-image.

Which coding agents can use build-cpo-image?
build-cpo-image installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.