RHIDP-14790: Add OLM v1 code path to install-rhdh-catalog-source.sh#3047
Conversation
Add --olm-version v0|v1|auto flag (default: auto) with CRD-based detection of OLM v1. When OLM v1 is detected, creates ClusterCatalog, ServiceAccount, ClusterRoleBinding, and ClusterExtension instead of OLM v0 CatalogSource, OperatorGroup, and Subscription. The IIB rendering/rebuild phase is shared by both paths. OLM v0 behavior is fully preserved for backward compatibility. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com> Assisted-by: Claude (claude-opus-4-6)
PR Summary by QodoAdd OLM v1 support to install-rhdh-catalog-source.sh Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1. Cluster-admin installer binding
|
… the operator-controller namespace and granting image-puller access to necessary service accounts. Update ClusterCatalog and ClusterRoleBinding creation to align with OLM v1 specifications.
…m-v-1-code-path-to-install-rhdh-catalog-source-sh
…mpatibility and a sample Custom Resource definition. Update role binding commands for clarity and consistency.
|
/agentic_review |
|
/review |
PR Reviewer Guide 🔍Warning
Here are some key observations to aid the review process:
|
…inding usage for testing. Ensure proper error handling for unsupported OLM versions.
|
/agentic_review |
…afer and more feature-rich.
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 9e42c86 |
…d image-puller role grants to service accounts. This ensures better visibility of potential issues with image pulls from the internal registry.
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 5a67b28 |
… in the install script, clarifying that this is intended for testing purposes only.
… The script now auto-detects OLM version and provides options for forcing OLM v1, improving usability for users configuring catalog sources.
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit db777b0 |
…cted OLM version. This ensures users are informed of any existing resources that may interfere with new installations, enhancing error handling and installation reliability.
…ment for improved readability and maintainability. This change enhances error handling for unsupported OLM versions.
…ed version checks for non-OpenShift environments. The auto-detection logic is now based solely on CRD presence, improving clarity and functionality.
OLM v1 detection is now platform-agnostic via CRD presence, so the usage description should not restrict it to OpenShift. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 44e36f1 |
The oc policy add-role-to-user commands are OpenShift-specific and would fail on plain Kubernetes clusters with OLM v1. Wrap them in IS_OPENSHIFT guards so the OLM v1 path works on non-OpenShift clusters. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
The early OLM presence check on non-OpenShift clusters only looked for the CatalogSource CRD (OLM v0). Kubernetes clusters with only OLM v1 would be rejected before reaching auto-detection. Now accept either CatalogSource or ClusterExtension CRD as evidence of OLM. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
The catalogd and operator-controller namespace fallbacks were hard-coded to OpenShift-specific names. Use olmv1-system as the fallback on non-OpenShift clusters to match upstream conventions. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
Makes the implicit global set by resolve_olm_version() visible alongside the other script-level variables for easier discoverability. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
… resource check The v0 stale-resource guard only checked for ClusterCatalog and ClusterExtension, missing the installer ServiceAccount and ClusterRoleBinding created by the v1 path. Switching from v1 to v0 could leave these RBAC resources behind with elevated privileges. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
…and catalog naming The usage text incorrectly implied ClusterExtension is always created on OLM v1 (it requires --install-operator), did not document the namespace where v1 resources are created, and claimed the catalog name is always operatorName-channelName without mentioning the brew override. Signed-off-by: Fortune Ndlovu <fndlovu@redhat.com>
|
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 2990296 |





Adds an
--olm-version v0|v1|autoCLI flag (default:auto) toinstall-rhdh-catalog-source.shwith CRD-based OLM v1 detection. When OLM v1 is detected (or forced), the script creates a ClusterCatalog and ClusterExtension with a ServiceAccount and ClusterRoleBinding, instead of the OLM v0 CatalogSource, Subscription, and OperatorGroup. Resolution is pinned to the custom catalog viaselector.matchLabels, and CRD upgrade safety preflight is disabled (enforcement: None) per the known blocker RHIDP-8656. The OLM v0 path is fully preserved for backward compatibility on older clusters.Which issue(s) does this PR fix or relate to
Resolves: https://redhat.atlassian.net/browse/RHIDP-14790
PR acceptance criteria
How to test changes / Special notes to the reviewer
Signed-off-by: Fortune-Ndlovu fndlovu@redhat.com
Assisted-by: Claude (claude-opus-4-6)