Skip to content

feat: patch kuadrant operator image via KUADRANT_OPERATOR_IMAGE#1009

Open
crstrn13 wants to merge 1 commit into
Kuadrant:mainfrom
crstrn13:kind/patch-kuadrant-image
Open

feat: patch kuadrant operator image via KUADRANT_OPERATOR_IMAGE#1009
crstrn13 wants to merge 1 commit into
Kuadrant:mainfrom
crstrn13:kind/patch-kuadrant-image

Conversation

@crstrn13

@crstrn13 crstrn13 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wire up the existing KUADRANT_OPERATOR_IMAGE variable (defined but unused in vars.mk) to actually patch the operator deployment image
  • Add a patch-kuadrant-operator-image target that uses kubectl set image to swap the manager container image when the variable is set
  • The patch runs after operator deployment (both components and helm modes), so you get the correct RBAC/CRDs/config from the gitref but run a custom-built image

Usage

KUADRANT_OPERATOR_IMAGE=quay.io/kuadrant/kuadrant-operator:my-tag make local-setup

Or standalone on an existing cluster:

KUADRANT_OPERATOR_IMAGE=quay.io/kuadrant/kuadrant-operator:my-branch make patch-kuadrant-operator-image

Test plan

  • Run make local-setup without KUADRANT_OPERATOR_IMAGE — operator deploys as before, skip message printed
  • Run make local-setup with KUADRANT_OPERATOR_IMAGE=<custom-image> — operator image is patched after deployment
  • Run make patch-kuadrant-operator-image standalone on an existing cluster with the variable set

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The Kuadrant Operator deployment now automatically applies a configured container image after installation.
    • When a custom operator image is set, the deployment waits for the updated rollout to complete.
    • If no custom image is provided, the deployment now skips the image update gracefully with a clear message.

Signed-off-by: Alexander Cristurean <acristur@redhat.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e5d0a34c-a728-44ff-b4e4-f59fd3cb513c

📥 Commits

Reviewing files that changed from the base of the PR and between 8fe7630 and 0682597.

📒 Files selected for processing (1)
  • make/kuadrant.mk

📝 Walkthrough

Walkthrough

The Kuadrant operator deploy flow now runs a new patch target after installation. That target conditionally updates the controller manager image from KUADRANT_OPERATOR_IMAGE, skips when the variable is unset, and waits for the rollout after patching.

Changes

Kuadrant operator image patching

Layer / File(s) Summary
Deploy flow calls patch target
make/kuadrant.mk
deploy-kuadrant-operator now invokes patch-kuadrant-operator-image after installation.
Conditional image patch target
make/kuadrant.mk
patch-kuadrant-operator-image patches the manager container image from KUADRANT_OPERATOR_IMAGE, skips when unset, and waits for rollout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through the makefile, neat and spry,
A patch for the operator passed me by.
If the image is set, then rollouts begin,
If not, I just grin and hop on again.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is conventional and clearly states the main change: patching the operator image via KUADRANT_OPERATOR_IMAGE.
Description check ✅ Passed It covers the purpose, main changes, usage, and test plan, which maps well to the required Description/Changes/Verification sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@crstrn13 crstrn13 self-assigned this Jun 25, 2026
Comment thread make/kuadrant.mk
$(MAKE) patch-kuadrant-operator-env
@echo "Kuadrant Operator $(KUADRANT_OPERATOR_VERSION) installed from Helm"
endif
$(MAKE) patch-kuadrant-operator-image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You think setting a custom kuadrant-operator image could be useful to expose for configuration in the Kuadrant's helm chart values yaml? Here, I suppose, we just use custom images for testing, but could it be also useful for other Kuadrant users?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, don't think a regular user should want to do this. The main reason I added this is because you can no longer change the wasm-shim image easily, since it is embedded in the kuadrant operator for now. But our releases should be the only versions a regular user should care about. Does that answer your question?

Comment thread make/kuadrant.mk
kubectl set image deployment/kuadrant-operator-controller-manager \
-n $(KUADRANT_NAMESPACE) \
manager=$(KUADRANT_OPERATOR_IMAGE)
kubectl -n $(KUADRANT_NAMESPACE) rollout status deployment/kuadrant-operator-controller-manager --timeout=$(KUBECTL_TIMEOUT)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would this stop the make target execution if fails?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, the rollout would fail on timeout if the pod isn't able to start. Maybe it isn't able to pull the image or stuff like that.

@azgabur azgabur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the advantage for patching kuadrant opeator image instead of deploying the needed version from released catalogSource? I can see only disadvantage of disconnecting operator version mentioned in catalogSource used for helm install and actual used kuadrant operator image. Such patch can be very hidden on long running cluster.

Why is this needed?

Patching relatedImages field in Subscription would be more persitent as well.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants