OADP-7868: Skip CLI/VMDP download setup when Console CRD is absent#2170
Conversation
On OCP 4.22 clusters without Console capability (e.g. SNO), the ConsoleCLIDownload CRD does not exist. The CLIDownloadSetup and VMDPDownloadSetup runnables crash with a REST mapper error because the code only handles errors.IsNotFound, not CRD-level absence. Check CRD availability via RESTMapper before proceeding. When the CRD is missing, skip all resource creation gracefully. Signed-off-by: Joseph <jvaikath@redhat.com>
|
@Joeavaikath: This pull request references OADP-7868 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR adds a new public function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 10 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/cherry-pick oadp-1.6 |
|
@Joeavaikath: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
this is good and should fix the bug. Ping me in slack as I'd also like to know how users can choose to turn off the running download servers. |
|
this also makes me wonder if it's time to setup a SNO testing job here in prow |
|
Signed-off-by: Joseph <jvaikath@redhat.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Joeavaikath, shubham-pampattiwar, weshayutin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
c927a46
into
openshift:oadp-dev
|
@Joeavaikath: new pull request created: #2173 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Why the changes were made
Fixes: OADP-7868
The OADP controller-manager enters
CrashLoopBackOffon OpenShift 4.22 clusters that do not have the Console capability enabled (e.g. SNO clusters).During startup, the
CLIDownloadSetupandVMDPDownloadSetuprunnables unconditionally interact with theConsoleCLIDownloadCRD (console.openshift.io/v1). On clusters without Console capability, this CRD does not exist, causing the REST mapper to fail with a discovery error. The code only handleserrors.IsNotFound(object-level absence) and does not account for CRD-level absence (meta.NoKindMatchError), resulting in a fatal error that terminates the manager.The fix probes the REST mapper for the
ConsoleCLIDownloadGVK at the top of each runnable'sStart()method. When the CRD is absent (meta.IsNoMatchError), setup is skipped gracefully — no deployment, service, route, orConsoleCLIDownloadresources are created. This is the correct behavior since these resources exist solely to surface CLI downloads through the Console UI, which is not present on these clusters.How to test the changes made
Run unit tests:
All 4 tests should pass, covering:
isConsoleCRDAvailablereturns false when CRD is absentisConsoleCRDAvailablereturns true when CRD is presentCLIDownloadSetup.Start()returns nil and creates no resources when CRD is absentVMDPDownloadSetup.Start()returns nil and creates no resources when CRD is absentDeploy on a cluster with Console capability and verify CLI/VMDP download resources are still created normally (no regression).
Deploy on a cluster without Console capability (e.g. SNO with Console disabled) and verify the operator starts successfully without CrashLoopBackOff. Logs should show:
Summary by CodeRabbit
Release Notes
New Features
Tests