Skip to content

HYPERFLEET-1411 - refactor: Update konflux + dev bundles - #29

Draft
ma-hill wants to merge 4 commits into
openshift-hyperfleet:mainfrom
ma-hill:HYPERFLEET-1411-3
Draft

HYPERFLEET-1411 - refactor: Update konflux + dev bundles#29
ma-hill wants to merge 4 commits into
openshift-hyperfleet:mainfrom
ma-hill:HYPERFLEET-1411-3

Conversation

@ma-hill

@ma-hill ma-hill commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Consolidates bundle build workflows by eliminating bundle.konflux.Dockerfile and using a single bundle.Dockerfile with build-time variant selection. This follows the same pattern as the catalog build, using a KUSTOMIZE_VARIANT build argument to select between dev (:latest tags) and production (digest-pinned) image references, reducing maintenance burden and ensuring consistency between development and CI builds.

HYPERFLEET-1411

Changes

  • Removed bundle.konflux.Dockerfile and consolidated into single bundle.Dockerfile with KUSTOMIZE_VARIANT build arg (defaults to config/manager/dev/kustomization.yaml)
  • Created config/manager/dev/kustomization.yaml for development builds using :latest image tags
  • Created config/manager/prod/kustomization.yaml for Konflux/production builds using digest-pinned image references (updated by Konflux build-nudges)
  • Removed bundle-hack/update_bundle.sh script (no longer needed with new variant-based approach)
  • Removed committed bundle/ directory contents (bundle manifests should be generated at build time, not committed)
  • Removed config/manager/kustomization.yaml (replaced by environment-specific variants)
  • Updated .tekton/hyperfleet-operator-bundle-push.yaml to use bundle.Dockerfile with KUSTOMIZE_VARIANT=config/manager/prod/kustomization.yaml build arg
  • Simplified Tekton pipeline trigger to only watch bundle.Dockerfile instead of multiple files (bundle.konflux.Dockerfile, bundle-hack/***, bundle/***)
  • Updated Makefile bundle targets to work with new variant-based structure

Notes

The variant system works by having the Dockerfile copy the specified kustomization file to override the base config/manager/kustomization.yaml before running kustomize build. This allows:

  • Dev builds: Use config/manager/dev/kustomization.yaml (default) with :latest tags for rapid iteration
  • Konflux/prod builds: Use config/manager/prod/kustomization.yaml with digest-pinned images that Konflux build-nudges automatically update

This eliminates the need to maintain two separate Dockerfiles and the update_bundle.sh script, reducing the surface area for drift between environments.

Test Plan

  • Built bundle locally with default dev variant: make bundle-build
  • Built bundle with prod variant: make bundle-build KUSTOMIZE_VARIANT=config/manager/prod/kustomization.yaml
  • Verified bundle manifests contain correct image references for each variant
  • Verified Konflux pipeline triggers on bundle.Dockerfile changes
  • Deployed bundle to development cluster and verified operator installs correctly

Gitlab Change: https://gitlab.cee.redhat.com/releng/konflux-release-data/-/merge_requests/22503

@openshift-ci

openshift-ci Bot commented Sep 10, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Sep 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ruclo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (2)
  • do-not-merge/work-in-progress
  • do-not-merge/hold

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 936f5c27-6125-4f15-8a68-ae9d2f6c5832

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: RELATED_IMAGE_HYPERFLEET_OPERATOR

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Need to properly update this in makefile?

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: RELATED_IMAGE_HYPERFLEET_OPERATOR

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not 100% sure bundle-nudges ref will update this but hopefully

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah you are right it won't get nudged. The build-service nudge regex is <repo>(:.*)?@(?<currentDigest>sha256:...) on a single token, so it only matches repo@sha256:digest on one line. Splitting into newName and digest means the two RELATED_IMAGE env values below get bumped but the controller image itself goes stale. Drop the images: block and patch the container image directly in the same patch list:

- op: replace
  path: /spec/template/spec/containers/0/image
  value: quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-operator@sha256:7504189fc375ee65457baa568487b9f083b35b882d58601cd4f4ad8ee50e639e

Nudging the redhat-services-prod path is fine btw, PR #27 already did that against the old Dockerfile.

Comment thread Makefile
Comment on lines 285 to 296
# Uninstall resources
# kubectl delete -f dist/install.yaml
# For image overrides edit config/manager/kustomization.yaml
.PHONY: build-deployer
build-deployer: manifests generate ## Generate a consolidated YAML with CRDs and deployment.
@mkdir -p dist
@$(KUSTOMIZE) build config/default > dist/install.yaml

.PHONY: build-deployer-override-img
build-deployer-override-img: manifests generate ## Generate deployer with IMG override, then restore kustomization.yaml
@mkdir -p dist
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Need to update this to work properly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah true true, With config/manager/kustomization.yaml gone, kustomize build config/default fails so make deploy and build-deployer are broken. One way to avoid both this and the cp hack in the Dockerfile: keep config/manager/kustomization.yaml as the dev default, and make prod an overlay under config/manifests/prod with resources: [../] plus the image patch. Then the Dockerfile arg just picks which manifests dir to kustomize build.

Comment thread bundle.Dockerfile

# Override the base kustomization.yaml
ARG KUSTOMIZE_VARIANT=dev/kustomization.yaml
RUN cp /workdir/config/manager/${KUSTOMIZE_VARIANT} \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this won't build on Konflux. The tekton push passes KUSTOMIZE_VARIANT=config/manager/prod/kustomization.yaml but this line prefixes /workdir/config/manager/ itself, so the cp target becomes config/manager/config/manager/prod/... and fails. Pick one convention, I'd go with the full repo path in the ARG

ARG KUSTOMIZE_VARIANT=config/manager/dev/kustomization.yaml
RUN cp /workdir/${KUSTOMIZE_VARIANT} /workdir/config/manager/kustomization.yaml &&
kustomize build /workdir/config/manifests > /workdir/manifests.yaml

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: RELATED_IMAGE_HYPERFLEET_OPERATOR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah you are right it won't get nudged. The build-service nudge regex is <repo>(:.*)?@(?<currentDigest>sha256:...) on a single token, so it only matches repo@sha256:digest on one line. Splitting into newName and digest means the two RELATED_IMAGE env values below get bumped but the controller image itself goes stale. Drop the images: block and patch the container image directly in the same patch list:

- op: replace
  path: /spec/template/spec/containers/0/image
  value: quay.io/redhat-services-prod/hyperfleet-tenant/hyperfleet/hyperfleet-operator@sha256:7504189fc375ee65457baa568487b9f083b35b882d58601cd4f4ad8ee50e639e

Nudging the redhat-services-prod path is fine btw, PR #27 already did that against the old Dockerfile.

pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main" && ( ".tekton/hyperfleet-operator-bundle-push.yaml".pathChanged() || "bundle.konflux.Dockerfile".pathChanged()
|| "bundle-hack/***".pathChanged() || "bundle/***".pathChanged() )
== "main" && ( ".tekton/hyperfleet-operator-bundle-push.yaml".pathChanged() || "bundle.Dockerfile".pathChanged())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The bundle content now comes from config/, but this only fires on bundle.Dockerfile. So a nudge PR touching config/manager/prod/kustomization.yaml never rebuilds the bundle. Worse, it does match the operator push (it only excludes the bundle Dockerfile and this file), so the operator rebuilds, gets a new digest, opens another nudge, and we loop. Add "config/***".pathChanged() here, and exclude the prod kustomization in the operator push CEL

Comment thread bundle.Dockerfile
@@ -1,3 +1,23 @@
FROM registry.k8s.io/kustomize/kustomize:v5.0.0 AS kustomize

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

registry.k8s.io and quay.io/operator-framework (line 11) aren't in the app-interface-standard base image allowlist, so Conforma fails base_image_permitted on the release, same thing we hit on the catalog PR. registry.redhat.io/openshift4/ose-operator-sdk-rhel9:v4.18 has operator-sdk, and registry.redhat.io/openshift4/ose-cli-rhel9:v4.18 gives you oc kustomize for the first stage.

provider:
name: Red Hat
url: https://github.com/openshift-hyperfleet
relatedImages:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think these placeholders are dead. operator-sdk replaces spec.relatedImages wholesale from the RELATED_IMAGE_* env vars (base.Spec.RelatedImages = g.RelatedImages), so they never make it into the bundle. Can drop them to save the next person wondering why they're empty.

Comment thread Makefile
$(CONTAINER_TOOL) build -f bundle.Dockerfile \
--platform $(PLATFORM) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNELS) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the Dockerfile ARG is CHANNELS but this passes CHANNEL, so make bundle-build CHANNELS=candidate silently builds stable. Also worth passing KUSTOMIZE_VARIANT through here so you can build the prod variant locally

Comment thread Makefile
Comment on lines 285 to 296
# Uninstall resources
# kubectl delete -f dist/install.yaml
# For image overrides edit config/manager/kustomization.yaml
.PHONY: build-deployer
build-deployer: manifests generate ## Generate a consolidated YAML with CRDs and deployment.
@mkdir -p dist
@$(KUSTOMIZE) build config/default > dist/install.yaml

.PHONY: build-deployer-override-img
build-deployer-override-img: manifests generate ## Generate deployer with IMG override, then restore kustomization.yaml
@mkdir -p dist
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah true true, With config/manager/kustomization.yaml gone, kustomize build config/default fails so make deploy and build-deployer are broken. One way to avoid both this and the cp hack in the Dockerfile: keep config/manager/kustomization.yaml as the dev default, and make prod an overlay under config/manifests/prod with resources: [../] plus the image patch. Then the Dockerfile arg just picks which manifests dir to kustomize build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants