-
Notifications
You must be signed in to change notification settings - Fork 9
operator: update from operatorhub feedback #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughChanges enhance operator metadata with expanded CRD descriptions and maintainer information, introduce sample resource manifests for Client, Exporter, ExporterAccessPolicy, and Lease resources, add a Makefile step to copy generated CRDs to operator configuration directories, document the Client resource, update manager image references, and provide a community contribution automation script. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
deploy/operator/config/manifests/bases/jumpstarter-operator.clusterserviceversion.yaml (1)
5-157: Add Jumpstarter example to alm-examples in base CSV to match bundle manifest.The base CSV is missing the Jumpstarter example that exists in the bundle CSV. While other fields (minKubeVersion, CRD descriptions, maintainers, icon) are consistent, the
alm-examplessection differs:
- Base: 4 examples (Client, Exporter, ExporterAccessPolicy, Lease)
- Bundle: 5 examples (Client, Exporter, ExporterAccessPolicy, Lease, Jumpstarter)
Add the Jumpstarter example to the base's alm-examples to maintain full parity with the bundle manifest:
{ "apiVersion": "operator.jumpstarter.dev/v1alpha1", "kind": "Jumpstarter", "metadata": { "name": "jumpstarter-sample" }, "spec": null }
🧹 Nitpick comments (3)
deploy/operator/contribute/update-contributions.sh (2)
16-16: Add error handling tocdcommand.Per shellcheck warning SC2164, the
cdcommand should include error handling to prevent the script from continuing in an unexpected directory if the change fails.Apply this fix:
-cd community-operators +cd community-operators || exit 1
18-18: Add error handling to VERSION extraction.The VERSION extraction on line 18 could fail silently if the CSV file is missing or malformed, leaving
VERSIONempty and causing line 23 to create a directory with an empty name. Add validation to detect and report extraction failures.Apply this fix:
VERSION=$(grep "^ version:" ../../bundle/manifests/jumpstarter-operator.clusterserviceversion.yaml | awk '{print $2}') + +if [ -z "$VERSION" ]; then + echo "Error: Failed to extract VERSION from ClusterServiceVersion manifest" + exit 1 +fiMakefile (1)
65-66: Consider adding defensive directory creation for the cp destination.The
cpcommand assumesdeploy/operator/config/crd/bases/exists. If the directory is missing, the copy will fail silently or produce an unclear error. Addmkdir -pto ensure the destination exists:# copy the crds to the operator bases directory + mkdir -p deploy/operator/config/crd/bases/ cp deploy/helm/jumpstarter/crds/* deploy/operator/config/crd/bases/Alternatively, verify this is a documented project setup requirement and that the directory is always present.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
Makefile(1 hunks)api/v1alpha1/client_types.go(1 hunks)deploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yaml(5 hunks)deploy/operator/config/manager/kustomization.yaml(1 hunks)deploy/operator/config/manifests/bases/jumpstarter-operator.clusterserviceversion.yaml(3 hunks)deploy/operator/config/samples/jumpstarter.dev_v1alpha1_client.yaml(1 hunks)deploy/operator/config/samples/jumpstarter.dev_v1alpha1_exporter.yaml(1 hunks)deploy/operator/config/samples/jumpstarter.dev_v1alpha1_exporteraccesspolicy.yaml(1 hunks)deploy/operator/config/samples/jumpstarter.dev_v1alpha1_lease.yaml(1 hunks)deploy/operator/config/samples/kustomization.yaml(1 hunks)deploy/operator/contribute/update-contributions.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter-controller PR: 170
File: deploy/operator/internal/controller/jumpstarter/jumpstarter_controller.go:328-333
Timestamp: 2025-10-24T11:57:23.796Z
Learning: In the jumpstarter-controller operator (deploy/operator/), the design allows only one Jumpstarter CR per namespace, which will be enforced by a validation webhook. This constraint eliminates concerns about resource name collisions within a namespace.
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter-controller PR: 169
File: deploy/operator/config/rbac/leader_election_role_binding.yaml:3-15
Timestamp: 2025-10-13T09:05:03.088Z
Learning: In Kubebuilder-generated Kubernetes operators, RBAC manifests (RoleBindings, Roles, etc.) under config/rbac/ typically do not include explicit `metadata.namespace` fields. The namespace is injected at build time by Kustomize via the `namespace` field in config/default/kustomization.yaml (or whichever kustomization file is used). This is intentional design to keep base manifests namespace-agnostic. Do not flag missing namespaces in such RBAC manifests as issues when they are part of a Kustomize-based operator deployment structure.
📚 Learning: 2025-10-24T11:57:23.796Z
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter-controller PR: 170
File: deploy/operator/internal/controller/jumpstarter/jumpstarter_controller.go:328-333
Timestamp: 2025-10-24T11:57:23.796Z
Learning: In the jumpstarter-controller operator (deploy/operator/), the design allows only one Jumpstarter CR per namespace, which will be enforced by a validation webhook. This constraint eliminates concerns about resource name collisions within a namespace.
Applied to files:
Makefiledeploy/operator/config/samples/jumpstarter.dev_v1alpha1_exporteraccesspolicy.yamldeploy/operator/config/manager/kustomization.yamldeploy/operator/config/samples/jumpstarter.dev_v1alpha1_lease.yamldeploy/operator/config/samples/kustomization.yamldeploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yamldeploy/operator/config/manifests/bases/jumpstarter-operator.clusterserviceversion.yaml
📚 Learning: 2025-10-24T11:57:13.484Z
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter-controller PR: 170
File: deploy/operator/internal/controller/jumpstarter/rbac.go:193-196
Timestamp: 2025-10-24T11:57:13.484Z
Learning: In the Jumpstarter operator codebase (deploy/operator/internal/controller/jumpstarter/rbac.go), the Role created by `createRole()` defines RBAC permissions for the managed Jumpstarter controller application, not for the operator itself. The managed controller needs delete permissions on secrets for its runtime operations.
Applied to files:
Makefiledeploy/operator/config/samples/jumpstarter.dev_v1alpha1_exporteraccesspolicy.yamldeploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yaml
📚 Learning: 2025-10-13T09:05:03.088Z
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter-controller PR: 169
File: deploy/operator/config/rbac/leader_election_role_binding.yaml:3-15
Timestamp: 2025-10-13T09:05:03.088Z
Learning: In Kubebuilder-generated Kubernetes operators, RBAC manifests (RoleBindings, Roles, etc.) under config/rbac/ typically do not include explicit `metadata.namespace` fields. The namespace is injected at build time by Kustomize via the `namespace` field in config/default/kustomization.yaml (or whichever kustomization file is used). This is intentional design to keep base manifests namespace-agnostic. Do not flag missing namespaces in such RBAC manifests as issues when they are part of a Kustomize-based operator deployment structure.
Applied to files:
deploy/operator/config/samples/kustomization.yaml
📚 Learning: 2025-05-13T19:57:56.811Z
Learnt from: NickCao
Repo: jumpstarter-dev/jumpstarter-controller PR: 137
File: hack/deploy_with_helm.sh:26-34
Timestamp: 2025-05-13T19:57:56.811Z
Learning: The jumpstarter-dev repository uses a custom kind cluster configuration that allows NodePort services to use non-standard ports 5080 and 5443, outside the default Kubernetes NodePort range (30000-32767).
Applied to files:
deploy/operator/config/samples/kustomization.yamldeploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yamldeploy/operator/config/manifests/bases/jumpstarter-operator.clusterserviceversion.yaml
📚 Learning: 2025-05-13T19:57:56.811Z
Learnt from: NickCao
Repo: jumpstarter-dev/jumpstarter-controller PR: 137
File: hack/deploy_with_helm.sh:26-34
Timestamp: 2025-05-13T19:57:56.811Z
Learning: The jumpstarter project uses a custom kind cluster configuration with an expanded NodePort range (3000-32767) and explicit port mappings for ingress (5080/5443) and gRPC services (30010/30011 mapped to 8082/8083).
Applied to files:
deploy/operator/config/samples/kustomization.yamldeploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yamldeploy/operator/config/manifests/bases/jumpstarter-operator.clusterserviceversion.yaml
📚 Learning: 2025-11-14T15:47:36.325Z
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter-controller PR: 190
File: api/v1alpha1/exporter_helpers.go:16-24
Timestamp: 2025-11-14T15:47:36.325Z
Learning: In the jumpstarter-controller project, migration annotations (jumpstarter.dev/migrated-namespace and jumpstarter.dev/migrated-uid) that override namespace and UID values in authentication tokens are acceptable without additional validation webhooks because the security model assumes only administrators have write access to Exporter and Client resources via K8s RBAC.
Applied to files:
deploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yamldeploy/operator/config/manifests/bases/jumpstarter-operator.clusterserviceversion.yaml
🪛 Shellcheck (0.11.0)
deploy/operator/contribute/update-contributions.sh
[warning] 16-16: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
(SC2164)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: deploy-kind
- GitHub Check: e2e-test-operator
- GitHub Check: e2e-tests (ubuntu-24.04)
- GitHub Check: e2e-tests (ubuntu-24.04-arm)
- GitHub Check: tests
- GitHub Check: lint-go
- GitHub Check: e2e-tests-release-0-7
🔇 Additional comments (8)
deploy/operator/config/samples/jumpstarter.dev_v1alpha1_lease.yaml (1)
1-11: Sample manifest is well-formed.The Lease sample is properly structured with appropriate field types and cross-references to client-sample.
deploy/operator/config/samples/jumpstarter.dev_v1alpha1_exporteraccesspolicy.yaml (1)
1-13: Sample manifest is well-formed.The ExporterAccessPolicy sample correctly demonstrates selector-based RBAC policy structure with proper metadata and policy rules.
deploy/operator/config/samples/jumpstarter.dev_v1alpha1_client.yaml (1)
1-8: Sample manifest is well-formed.The Client sample demonstrates proper resource structure with metadata labels and authentication configuration.
deploy/operator/config/samples/jumpstarter.dev_v1alpha1_exporter.yaml (1)
1-7: Sample manifest is well-formed.The Exporter sample correctly demonstrates resource creation with metadata labels and an empty spec (indicating no required configuration).
deploy/operator/config/samples/kustomization.yaml (1)
4-7: Sample resource references are complete and correct.All four new sample resources are properly registered in the kustomization file and match the corresponding manifest files created in this PR.
deploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yaml (3)
5-88: Well-structured sample resources in alm-examples.The four new samples (Client, Exporter, ExporterAccessPolicy, Lease) provide clear examples for users and follow consistent formatting with the existing Jumpstarter sample. The Client sample correctly illustrates OIDC provider integration via
username: "keycloak:user-name-in-keycloak", and the ExporterAccessPolicy sample demonstrates selector-based access control patterns.
99-129: Comprehensive CRD descriptions enhance operator discoverability.The new descriptions for Client, ExporterAccessPolicy, Exporter, and Lease are informative and include relevant documentation links (e.g., Exporter and Lease descriptions reference the Jumpstarter docs). The descriptions will improve user experience in OLM (Operator Lifecycle Manager) catalogs and community marketplaces.
470-478: Verify minKubeVersion 1.28.0 reflects actual project requirements.Two new maintainers have been added (Benny Zlotnik, Bella Khizgiyaev), and
minKubeVersionis now set to1.28.0. Confirm that this version constraint aligns with the minimum supported Kubernetes version across the codebase and CI/CD pipeline. Additionally, verify the base64-encoded SVG icon is valid when decoded (not critical but good practice).
| images: | ||
| - name: controller | ||
| newName: quay.io/jumpstarter-dev/jumpstarter-operator | ||
| newName: quay.io/jumpstarte-dev/jumpstarter-operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Typo in image registry organization name.
Line 7 contains a typo in the image repository path: quay.io/jumpstarte-dev/ is missing an 'r' and should be quay.io/jumpstarter-dev/. This will cause image pull failures at deployment time.
Apply this fix:
- newName: quay.io/jumpstarte-dev/jumpstarter-operator
+ newName: quay.io/jumpstarter-dev/jumpstarter-operator📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| newName: quay.io/jumpstarte-dev/jumpstarter-operator | |
| newName: quay.io/jumpstarter-dev/jumpstarter-operator |
🤖 Prompt for AI Agents
In deploy/operator/config/manager/kustomization.yaml around line 7, the newName
image path contains a typo: "quay.io/jumpstarte-dev/jumpstarter-operator" is
missing an 'r' in the organization name; update the value to
"quay.io/jumpstarter-dev/jumpstarter-operator" so the image reference matches
the correct registry organization and prevents image pull failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the typo in the image may be related to the check-bundele failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for CI workflows and scripts related to bundle checking
echo "=== Searching for check-bundle related files ==="
fd -t f "check.*bundle|bundle.*check" -i
echo -e "\n=== Searching for GitHub workflow files ==="
fd -t f ".yml$|.yaml$" .github/workflows
echo -e "\n=== Searching for references to 'check-bundle' or 'check-bundele' in code ==="
rg -i "check.*bundle|bundle.*check" -A 2 -B 2
echo -e "\n=== Searching Makefile for bundle-related targets ==="
rg "^[a-zA-Z0-9_-]+.*bundle" Makefile -A 3
echo -e "\n=== Looking at deploy/operator directory structure ==="
fd -t f . deploy/operator -d 2
Length of output: 802
🏁 Script executed:
#!/bin/bash
# Examine the check-bundle workflow
echo "=== Contents of check-bundle.yaml ==="
cat .github/workflows/check-bundle.yaml
echo -e "\n=== Looking for operator-sdk or bundle validation commands ==="
rg "operator-sdk.*bundle|bundle.*validate" -A 2 -B 2
echo -e "\n=== Check the operator Makefile for bundle targets ==="
cat deploy/operator/Makefile | grep -A 10 "^bundle:"
Length of output: 5109
@bkhizgiy You're absolutely correct! 🎯
The typo is indeed causing the check-bundle failure. Here's what's happening:
- The CI workflow runs
make bundle IMG="quay.io/jumpstarter-dev/jumpstarter-operator:${TAG}"with the correct image name - The bundle generation includes a kustomize command that updates
config/manager/kustomization.yamlwith the provided IMG value - Since the file currently has the typo (
jumpstarte-dev), the regeneration creates it with the correct name (jumpstarter-dev) - This produces a diff between what's committed and what's generated, causing the check to fail with "Uncommitted changes detected"
The fix is to revert the typo back to the correct image name as I suggested in my initial review comment. Once corrected, the check-bundle workflow will pass because there will be no diff between the committed file and the regenerated one.
🧠 Learnings used
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter-controller PR: 170
File: deploy/operator/internal/controller/jumpstarter/jumpstarter_controller.go:328-333
Timestamp: 2025-10-24T11:57:23.796Z
Learning: In the jumpstarter-controller operator (deploy/operator/), the design allows only one Jumpstarter CR per namespace, which will be enforced by a validation webhook. This constraint eliminates concerns about resource name collisions within a namespace.
feedback, warning and fixes contributed here k8s-operatorhub/community-operators#7140 but we keep our csv locally for generating the bundle.
Summary by CodeRabbit
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.