OSAC-2238: expose dispatcher manager resolution as pkg/ utility for cross-operator import - #158
Conversation
Define a NetworkClassFetcher interface and NetworkClassInfo struct that abstract the NetworkClass fetch operation, allowing bare-metal-fulfillment- operator (and other external modules) to import pkg/dispatcher without depending on internal/api/ types. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Dan Manor <dmanor@redhat.com>
Replace the privatev1.NetworkClassesClient dependency with the NetworkClassFetcher interface, removing the internal/api/ import from pkg/dispatcher. Update all test stubs to implement the new interface. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Dan Manor <dmanor@redhat.com>
Provide GRPCNetworkClassFetcher in internal/adapters that wraps the generated privatev1.NetworkClassesClient to implement the dispatcher.NetworkClassFetcher interface. This gives osac-operator a drop-in adapter for its existing gRPC client setup. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Dan Manor <dmanor@redhat.com>
|
@danmanor: This pull request references OSAC-2238 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. 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 APPROVED This pull-request has been approved by: danmanor 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 |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
WalkthroughThe dispatcher now retrieves NetworkClass manager names through a ChangesNetworkClass fetching and resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: ✨ 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 |
OSAC-2238: Expose dispatcher manager resolution as pkg/ utility for cross-operator import
Jira: https://redhat.atlassian.net/browse/OSAC-2238
Summary
The
pkg/dispatcherpackage'sResolverdepended onprivatev1.NetworkClassesClientfrominternal/api/, which blockedbare-metal-fulfillment-operatorfrom importing it (Go'sinternal/visibility rules). This PR introduces aNetworkClassFetcherinterface inpkg/dispatcher/that abstracts the NetworkClass fetch, and provides a gRPC adapter ininternal/adapters/for osac-operator's own use.Changes
pkg/dispatcher/
NetworkClassFetcherinterface andNetworkClassInfostruct (network_class_fetcher.go)Resolverto acceptNetworkClassFetcherinstead ofprivatev1.NetworkClassesClientinternal/api/import fromresolver.gointernal/adapters/
GRPCNetworkClassFetcherthat wrapsprivatev1.NetworkClassesClientto implementdispatcher.NetworkClassFetcherTesting
pkg/dispatcher92.5%,internal/adapters100%Acceptance Criteria
pkg/dispatcheris importable bybare-metal-fulfillment-operator(nointernal/imports)Resolverhas nointernal/api/dependency in its public APISummary by CodeRabbit
New Features
Bug Fixes
Tests