56 results available
Sign in
Skills directory

build-ho-image

openshift

·

Last changed
Hardened

This skill has been hardened by Chainguard

Last changed

This version passed the hardening gate. Hardening applied 13 targeted changes and preserved all other text. Classified findings before hardening: 1. Classified findings closed: 1. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 17. Review findings remaining: 0.


Open before hardening

1

Low
Open after hardening

None


Expand
File
Group
Subtype
Severity
Status
SKILL.md

Malicious Code & Command Execution

Command injection

Low
Closed

1 finding


SKILL.md

Build HyperShift-Operator Image

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

When to Use This Skill

Use this skill only when the user asks, for example when:

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

Prerequisites

Ask the user to set HO_IMAGE_REPO and RUNTIME in their own shell before using this skill. If the user wants to load them from dev/claude-env.sh, first show the user the full contents of that file, and load it only after the user confirms it is their own trusted local config. Stop and report to the user if either variable is unset or empty.

Image Registry Configuration

Environment variables from dev/claude-env.sh:

VariableDescription

HO_IMAGE_REPO

Container registry for HO images

RUNTIME

Container runtime (podman/docker)

Building the HO Image

Before running any command below, check that RUNTIME is exactly podman or docker, that HO_IMAGE_REPO is set, not empty, and a single word with no spaces or shell characters, and that TAG contains only letters, digits, dots, dashes and underscores. Stop and report to the user if any check fails.

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"

Prefer Option 2, the short commit hash. A tag taken from a branch name must pass the tag character check above; if it does not, use the short commit hash instead. Use a unique tag so existing images in a shared repository are kept intact.

Step 2: Build the Image

Before building, show the user the output of git status and any changes to the Dockerfile and Makefile, and build only after the user confirms the working tree is trusted. The whole repository is the build context, so confirm with the user that secrets and local env files such as dev/claude-env.sh are excluded from it.

The HO image uses the main Dockerfile:

$RUNTIME build -f Dockerfile --platform linux/amd64 -t $HO_IMAGE_REPO:$TAG .

Note: The build runs make hypershift, make hypershift-operator, make karpenter-operator, and make product-cli inside the container.

Step 3: Push the Image

Before pushing, show the user the full image reference, repository and tag, and get explicit approval. Ask the user to confirm that HO_IMAGE_REPO is their own intended private or personal repository, since the image contains unreleased code.

$RUNTIME push $HO_IMAGE_REPO:$TAG

Quick One-Liner

Build and push in one command. This also pushes, so run the same checks and get the same user approval first. Replace the example tag with a unique tag, preferably the short commit hash, and record the pushed image digest so deployments can use the digest where possible:

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

Iteration Workflow

When iterating on HO fixes:

  1. Make code changes in hypershift-operator/
  2. Build and push image with incremented tag (e.g., fix-1, fix-2, fix-3)
  3. Check which cluster the current kubectl context targets, show it to the user, and reinstall HyperShift with new image only after the user confirms it is a dev or test cluster
  4. Run e2e test or manual validation
  5. Analyze results
  6. Repeat until test passes

What Gets Built

The main Dockerfile builds:

  • hypershift CLI binary
  • hypershift-no-cgo binary
  • hypershift-operator binary
  • karpenter-operator binary
  • hcp (product CLI) binary

All are included in the final image.

Troubleshooting

Build Fails

  • Verify module checksums first with go mod verify. Run go mod vendor only with user approval, and review the module checksum and vendor changes with the user before building.
  • Ensure code compiles locally: make hypershift-operator
  • Check for API generation issues: make api

Push Fails

  • Verify registry login: $RUNTIME login quay.io
  • The user runs the login command themselves; keep registry passwords and tokens out of the conversation, commands, and logs. Log in to the registry named in HO_IMAGE_REPO; quay.io is only the common case.
  • Check repository permissions

Operator Not Running After Install

  • Before any kubectl command, confirm with the user that the current kubectl context is the intended dev or test cluster.
  • Check operator logs: kubectl logs -n hypershift deployment/operator
  • Verify image pull succeeded: kubectl describe pod -n hypershift -l app=operator
  • Ensure cluster can pull from registry

Changes Not Reflected

  • Make sure you're using the correct image tag
  • Check if old pods are still running: kubectl get pods -n hypershift
  • Force rollout, only after confirming the cluster context and getting user approval: kubectl rollout restart deployment/operator -n hypershift

Install

Install with chainctl
chainctl skill install public/openshift/build-ho-image:latest
Get started with chainctl
View source

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream sourcehttps://github.com/openshift/hypershift
Upstream commit245efe6d14bebcde3d7d8de22942a9973c2cbe81
OCI reference

skills.cgr.dev/public/github.com/openshift/.claude/skills/dev/build-ho-image:latest

License

Apache-2.0

Files

HARDENING.md

LICENSE

SKILL.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.