Skip to content

Import some of the operator-related release improvements to main#390

Open
mangelajo wants to merge 4 commits intomainfrom
port-pr-389-to-main
Open

Import some of the operator-related release improvements to main#390
mangelajo wants to merge 4 commits intomainfrom
port-pr-389-to-main

Conversation

@mangelajo
Copy link
Copy Markdown
Member

Releasing 0.8.1 required a few changes and improvements in release-0.8, applied in #389 , this PR cherry picks those changes to main, so next time we need to release this process should be easier.

This also includes some agent instructions to help us do the operator release.

Use IMAGE_TAG_BASE instead of 'controller' in kustomize edit set image
so the image name actually matches what manager.yaml declares. Fix the
kustomization.yaml image entry name to match the real image reference.

Add a post-generation step in the bundle target to align the CSV
containerImage annotation with the actual IMG value.

Made-with: Cursor
(cherry picked from commit 93230f9)
(cherry picked from commit fcb1ac7)
(cherry picked from commit 7f5cc6d)
Add guidance on ensuring REPLACES points to the most recently published
version in the channel (including release candidates) to avoid multiple
channel heads in the OLM graph.

Made-with: Cursor
(cherry picked from commit 59d6d3b)
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 9f698ef
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/69c5900e3767470008a2b416
😎 Deploy Preview https://deploy-preview-390--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

📝 Walkthrough

Walkthrough

This PR introduces release documentation for the Kubernetes operator and refactors image tagging logic. It adds a release runbook describing versioning, bundle generation, and OLM community-operators workflow. Makefile changes standardize image defaults to use IMAGE_TAG_BASE and VERSION, add a print-img target, and update deployment variable resolution to use this target.

Changes

Cohort / File(s) Summary
Release Documentation
.claude/rules/releasing-operator.md, .cursor/rules/releasing-operator.mdc, CLAUDE.md
Added comprehensive release runbook documenting end-to-end operator versioning, bundle generation, OLM/community-operators workflow, and validation checklist. Updated project rules index to reference the new runbook.
Operator Makefile & Image Configuration
controller/deploy/operator/Makefile, controller/deploy/operator/config/manager/kustomization.yaml
Changed IMG default from hard-coded latest to computed value using IMAGE_TAG_BASE and VERSION. Added print-img phony target for image tag resolution. Extended bundle target to rewrite CSV container image annotation. Updated Kustomize image reference name from controller to full registry path.
Deployment Variable Resolution
controller/hack/deploy_vars
Updated OPERATOR_IMG default to dynamically resolve via make print-img target, with fallback to original hard-coded value if unavailable.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • kirkbrauer
  • bennyz

Poem

🐰 A carrot-sized bundle, a version so fine,
Image tags aligned in a straight operator line,
From Makefile to CSV, the tags now agree,
Release automation hops wild and free! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective: cherry-picking operator release improvements from release-0.8 to main for easier future releases.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of cherry-picking release improvements and mentioning agent instructions included in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch port-pr-389-to-main

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.cursor/rules/releasing-operator.mdc (1)

59-60: Minor documentation clarification.

The statement "The newTag field is updated automatically by make bundle" may be misleading. Looking at the Makefile, kustomize edit set image is called, which updates the kustomization.yaml in-place. However, since bundle/ is not committed (per line 94), and the kustomization.yaml changes would persist in the working tree, this could cause unexpected diffs if developers don't reset after running make bundle.

Consider clarifying whether developers should expect and commit these kustomization.yaml changes, or if they should be reverted after bundle generation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/rules/releasing-operator.mdc around lines 59 - 60, The doc line
saying "The `newTag` field is updated automatically by `make bundle`" is
ambiguous; update the text in releasing-operator.mdc to mention that `make
bundle` invokes `kustomize edit set image` which mutates kustomization.yaml
in-place, clarify that generated changes will remain in the working tree (since
`bundle/` is not committed) and state whether developers should commit those
kustomization.yaml changes or revert/reset them after running `make bundle`;
reference the commands `make bundle`, `kustomize edit set image`, and the
`newTag` field so readers know exactly what to expect and what action (commit vs
revert) to take.
controller/hack/deploy_vars (1)

9-9: Silent fallback may mask configuration issues.

The 2>/dev/null suppression combined with the || echo fallback means if the make print-img command fails (e.g., wrong working directory, missing dependencies), the script silently falls back to :latest instead of the versioned tag (0.8.1-rc.1). This could lead to deploying an unexpected image without any indication.

Consider emitting a warning when the fallback is used:

Proposed fix to warn on fallback
-OPERATOR_IMG=${OPERATOR_IMG:-$(make -C deploy/operator --no-print-directory -s print-img 2>/dev/null || echo "quay.io/jumpstarter-dev/jumpstarter-operator:latest")}
+OPERATOR_IMG=${OPERATOR_IMG:-$(_img=$(make -C deploy/operator --no-print-directory -s print-img 2>/dev/null) && echo "$_img" || { echo -e "${YELLOW}Warning: Could not resolve operator image from Makefile, using :latest fallback${NC}" >&2; echo "quay.io/jumpstarter-dev/jumpstarter-operator:latest"; })}

Alternatively, if this is intentional for flexibility in non-operator contexts, a code comment explaining the fallback behavior would help future maintainers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@controller/hack/deploy_vars` at line 9, The OPERATOR_IMG assignment silently
swallows errors by redirecting stderr (2>/dev/null) and falling back to a
default tag via `|| echo`, which can hide misconfigurations; update the logic
around OPERATOR_IMG to capture the exit status/output of `make -C
deploy/operator --no-print-directory -s print-img` (or run it without
redirecting stderr), and if the make command fails emit a clear warning to
stderr (or to the existing logger) that the fallback
`quay.io/jumpstarter-dev/jumpstarter-operator:latest` is being used, then
continue with the fallback; alternatively, if silent fallback is intended, add
an inline comment next to the OPERATOR_IMG assignment explaining the deliberate
suppression and fallback behavior for future maintainers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.cursor/rules/releasing-operator.mdc:
- Around line 59-60: The doc line saying "The `newTag` field is updated
automatically by `make bundle`" is ambiguous; update the text in
releasing-operator.mdc to mention that `make bundle` invokes `kustomize edit set
image` which mutates kustomization.yaml in-place, clarify that generated changes
will remain in the working tree (since `bundle/` is not committed) and state
whether developers should commit those kustomization.yaml changes or
revert/reset them after running `make bundle`; reference the commands `make
bundle`, `kustomize edit set image`, and the `newTag` field so readers know
exactly what to expect and what action (commit vs revert) to take.

In `@controller/hack/deploy_vars`:
- Line 9: The OPERATOR_IMG assignment silently swallows errors by redirecting
stderr (2>/dev/null) and falling back to a default tag via `|| echo`, which can
hide misconfigurations; update the logic around OPERATOR_IMG to capture the exit
status/output of `make -C deploy/operator --no-print-directory -s print-img` (or
run it without redirecting stderr), and if the make command fails emit a clear
warning to stderr (or to the existing logger) that the fallback
`quay.io/jumpstarter-dev/jumpstarter-operator:latest` is being used, then
continue with the fallback; alternatively, if silent fallback is intended, add
an inline comment next to the OPERATOR_IMG assignment explaining the deliberate
suppression and fallback behavior for future maintainers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a477127f-e440-401d-a977-15d493f96eae

📥 Commits

Reviewing files that changed from the base of the PR and between 03fc412 and 9f698ef.

📒 Files selected for processing (6)
  • .claude/rules/releasing-operator.md
  • .cursor/rules/releasing-operator.mdc
  • CLAUDE.md
  • controller/deploy/operator/Makefile
  • controller/deploy/operator/config/manager/kustomization.yaml
  • controller/hack/deploy_vars

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.

1 participant