Skip to content

Assuming ceph version is >= 19 if not determined for ODF 4.18 and above#15149

Merged
petr-balogh merged 1 commit into
red-hat-storage:masterfrom
petr-balogh:assume-ceph-19-for-odf-4.18-and-above-if-not-determined
May 14, 2026
Merged

Assuming ceph version is >= 19 if not determined for ODF 4.18 and above#15149
petr-balogh merged 1 commit into
red-hat-storage:masterfrom
petr-balogh:assume-ceph-19-for-odf-4.18-and-above-if-not-determined

Conversation

@petr-balogh
Copy link
Copy Markdown
Member

@petr-balogh petr-balogh commented May 14, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced handling of external Ceph cluster deployments when cluster version detection fails. The system now defaults to using the cephadm-based certificate retrieval method for unknown versions, ensuring proper compatibility with Ceph >= 19. This provides more reliable certificate fetching in edge cases.

Review Change Stack

Signed-off-by: Petr Balogh <pbalogh@redhat.com>
@petr-balogh petr-balogh requested a review from a team as a code owner May 14, 2026 06:58
@openshift-ci openshift-ci Bot added the lgtm label May 14, 2026
@petr-balogh petr-balogh added the Verified Mark when PR was verified and log provided label May 14, 2026
@petr-balogh
Copy link
Copy Markdown
Member Author

petr-balogh commented May 14, 2026

I have verified as part of Cherry-pick of Shivam's PR in release-4.21 here: #15148

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

📝 Walkthrough

Walkthrough

Modified external_rgw_ca_should_use_cephadm_fetch() to return True when external Ceph version cannot be determined, treating unknown versions as Ceph >= 19 and using the cephadm certificate-fetch path instead of falling back to the rgw_cert_ca URL path.

Changes

Cephadm CA fetch behavior

Layer / File(s) Summary
Version-based CA fetch path selection
ocs_ci/deployment/helpers/external_cluster_helpers.py
external_rgw_ca_should_use_cephadm_fetch() now returns True when the Ceph version cannot be determined (_external_ceph_semantic_version_or_none() returns None), changing the fallback from the rgw_cert_ca URL path to using cephadm_root_ca_cert.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 When Ceph's version hides in the dark,
We trust the newer path's bright spark!
Unknown becomes eleven-nines (or more),
Cephadm cert-fetch opens the door. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating the logic to assume Ceph version >= 19 when version detection fails for ODF 4.18+.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 14, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dahorak, petr-balogh, vavuthu

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@petr-balogh
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ocs_ci/deployment/helpers/external_cluster_helpers.py`:
- Around line 1211-1213: The current branch returns True for v is None
unconditionally; instead, when v is None, only return True if the detected ODF
release is 4.18 or newer. Change the `if v is None:` branch to call
`version.get_semantic_version("4.18", only_major_minor=True)` (or your existing
ODF version lookup) and return the result of comparing that ODF semver against
4.18 (i.e., return odf_semver is not None and odf_semver >=
version.get_semantic_version("4.18", only_major_minor=True)); otherwise fall
through to the existing `return v >= version.get_semantic_version("19.0",
only_major_minor=True)` logic. This ties the unknown-version fallback to ODF >=
4.18 rather than applying it unconditionally.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e6333016-017b-4883-90af-3e299d467be9

📥 Commits

Reviewing files that changed from the base of the PR and between cfa5523 and b21acb6.

📒 Files selected for processing (1)
  • ocs_ci/deployment/helpers/external_cluster_helpers.py

Comment on lines 1211 to 1213
if v is None:
return False
return True
return v >= version.get_semantic_version("19.0", only_major_minor=True)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Gate unknown-version fallback to ODF 4.18+ only.

At Line 1212, None now maps to True unconditionally, which applies the Ceph >=19 path for all ODF versions. The PR objective/docstring scopes this assumption to ODF 4.18 and newer.

🔧 Proposed fix
 def external_rgw_ca_should_use_cephadm_fetch():
@@
     v = _external_ceph_semantic_version_or_none()
     if v is None:
-        return True
+        odf_version = version.get_semantic_ocs_version_from_config()
+        return odf_version >= version.VERSION_4_18
     return v >= version.get_semantic_version("19.0", only_major_minor=True)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ocs_ci/deployment/helpers/external_cluster_helpers.py` around lines 1211 -
1213, The current branch returns True for v is None unconditionally; instead,
when v is None, only return True if the detected ODF release is 4.18 or newer.
Change the `if v is None:` branch to call `version.get_semantic_version("4.18",
only_major_minor=True)` (or your existing ODF version lookup) and return the
result of comparing that ODF semver against 4.18 (i.e., return odf_semver is not
None and odf_semver >= version.get_semantic_version("4.18",
only_major_minor=True)); otherwise fall through to the existing `return v >=
version.get_semantic_version("19.0", only_major_minor=True)` logic. This ties
the unknown-version fallback to ODF >= 4.18 rather than applying it
unconditionally.

@petr-balogh petr-balogh merged commit a2eb5be into red-hat-storage:master May 14, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm size/XS Verified Mark when PR was verified and log provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants