SREP-3940: Add --hive-ocm-url flag to cluster break-glass for multi-env OCM support#864
Conversation
|
@nephomaniac: An error was encountered searching for bug SREP-3940 on the Jira server at https://issues.redhat.com. No known errors were detected, please see the full error message for details. Full error message.
No response returned: Get "https://issues.redhat.com/rest/api/2/issue/SREP-3940": GET https://issues.redhat.com/rest/api/2/issue/SREP-3940 giving up after 5 attempt(s)
Please contact an administrator to resolve this issue, then request a bug refresh with 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. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughAdds a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nephomaniac 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 |
|
Placing on hold until all the similar commands/PRs adding multiple OCM env support can have the common impl pattern reviewed. Will unhold after the other PRs, and general pattern get a chance for review. |
4e00788 to
f413494
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmd/cluster/access/access.go`:
- Around line 174-177: The hive lookup is using the user-provided c.clusterID
which can be a name/external ID; change the call to osdctlutil.GetHiveCluster to
use the already-resolved internal ID from cluster.ID() instead of c.clusterID
(ensure the local variable named cluster is in scope and pass cluster.ID() into
GetHiveCluster so hive interactions use the internal cluster ID as intended).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b3b2b5ae-0c6f-4bdd-99dc-7f9c0f53024b
📒 Files selected for processing (3)
cmd/cluster/access/access.godocs/README.mddocs/osdctl_cluster_break-glass.md
| hive, err = osdctlutil.GetHiveCluster(c.clusterID) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to retrieve hive shard for %q: %w", c.clusterID, err) | ||
| } |
There was a problem hiding this comment.
Use internal cluster ID for default hive lookup to avoid lookup failures.
At Line 174, the default path uses c.clusterID (user input), while the flow already resolved cluster.ID() and the comment at Lines 138-139 states hive interactions should use internal ID. This can fail for name/external-ID inputs and breaks backward-compat expectations.
🔧 Proposed fix
- hive, err = osdctlutil.GetHiveCluster(c.clusterID)
+ hive, err = osdctlutil.GetHiveCluster(cluster.ID())
if err != nil {
return fmt.Errorf("failed to retrieve hive shard for %q: %w", c.clusterID, err)
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cmd/cluster/access/access.go` around lines 174 - 177, The hive lookup is
using the user-provided c.clusterID which can be a name/external ID; change the
call to osdctlutil.GetHiveCluster to use the already-resolved internal ID from
cluster.ID() instead of c.clusterID (ensure the local variable named cluster is
in scope and pass cluster.ID() into GetHiveCluster so hive interactions use the
internal cluster ID as intended).
f413494 to
b978c75
Compare
|
@nephomaniac: An error was encountered searching for bug SREP-3940 on the Jira server at https://issues.redhat.com. No known errors were detected, please see the full error message for details. Full error message.
No response returned: Get "https://issues.redhat.com/rest/api/2/issue/SREP-3940": GET https://issues.redhat.com/rest/api/2/issue/SREP-3940 giving up after 5 attempt(s)
Please contact an administrator to resolve this issue, then request a bug refresh with 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. |
b978c75 to
b520a7d
Compare
|
/retest |
|
@nephomaniac: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Summary
Adds
--hive-ocm-urlflag toosdctl cluster break-glasscommand to enable multi-environment OCM support for staging/integration testing.Changes
--hive-ocm-urloptional flag to break-glass commandaccessCmdComplete()to fail fast on invalid OCM URLsaccess_test.goto verify early validation behaviorImplementation Details
When
--hive-ocm-urlis specified:utils.CreateConnectionWithUrl()utils.GetHiveClusterWithConn()to query hive from different OCM environmentk8s.NewAsBackplaneClusterAdminWithConn()utils.ValidateAndResolveOcmUrl()Testing
Related
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com