OCPBUGS-60640: return clean error for upgrade status on HyperShift clusters - #2347
OCPBUGS-60640: return clean error for upgrade status on HyperShift clusters#2347savio87 wants to merge 2 commits into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@savio87: This pull request references Jira Issue OCPBUGS-60640, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: savio87 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @savio87. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe upgrade status command now retrieves the cluster Infrastructure resource during live execution. It returns retrieval errors and rejects clusters with ChangesUpgrade status validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Adds an early Infrastructure.status.controlPlaneTopology == External check (same pattern used in recommend/alerts.go) to return a clean error message on HyperShift clusters before any MCO/MCP API calls. Could a maintainer update the target version on OCPBUGS-60640 and run /ok-to-test? Thanks! |
There was a problem hiding this comment.
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 `@pkg/cli/admin/upgrade/status/status.go`:
- Around line 211-213: Wrap the error returned by the Infrastructures().Get call
in the upgrade status flow with fmt.Errorf, adding clear context such as failure
to get the cluster Infrastructure while preserving the original error with %w.
🪄 Autofix
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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 58a5b7f9-3666-4731-ba29-8fbe345e6a2e
📒 Files selected for processing (1)
pkg/cli/admin/upgrade/status/status.go
Co-authored-by: Cursor <cursoragent@cursor.com>
| } | ||
| if infra.Status.ControlPlaneTopology == configv1.ExternalTopologyMode { | ||
| return fmt.Errorf("upgrade status is not supported on Hosted Control Plane (HyperShift) clusters") | ||
| } |
There was a problem hiding this comment.
Since there is already
func isHostedCluster(i *configv1.Infrastructure) bool {
return i != nil && i.Status.ControlPlaneTopology == configv1.ExternalTopologyMode
}in alerts.go, can we put that helper into a shared package and use that wherever necessary?
Summary
oc adm upgrade statuscrashes on HyperShift/HCP clusters with "Error from server (NotFound): deployments.apps "machine-config-operator" not found" because it assumes the MCO deployment exists.This adds an early check for
Infrastructure.status.controlPlaneTopology == External(the canonical HyperShift detection pattern, already used inrecommend/alerts.go) and returns a clean error message before any MCO/MCP API calls.Bug: https://redhat.atlassian.net/browse/OCPBUGS-60640
Changes
status.goRun()usingExternalTopologyModecheckSummary by CodeRabbit