Introduce an SDK seam so the reconcile logic is unit-testable - #96
Introduce an SDK seam so the reconcile logic is unit-testable#96aswinsuryan wants to merge 1 commit into
Conversation
The GCP platform's interfaces sat at the Platform level, leaving the logic that decides what to write to the Cloud Router and to NCC spokes with no boundary a test could substitute below it, so it could only run against live Google APIs. AWS addressed the same problem in PR openshift#69 with its ec2API seam; this brings that shape to GCP. The seam lives at the SDK boundary: - computeAPI / gceAPI in compute.go - nccAPI / gcpNCCAPI in ncc.go The concrete pass-throughs are the only code that touches the SDK; the reconcile logic moves above them with its behavior unchanged, and a fake can now stand in for Google in tests. Unlike ec2API these are semantic seams rather than method-for-method mirrors, because the GCE and NCC clients are fluent builders with no interface to mirror. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Aswin Suryanarayanan <asuryana@redhat.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Warning Review limit reachedNext included review available in 54 minutes. View limit detailsLimit details: You’ve used the included review currently available. This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Review configuration: ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aswinsuryan 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 |
|
@aswinsuryan: The following test failed, say
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. |
The GCP platform's interfaces sat at the Platform level, leaving the logic that decides what to write to the Cloud Router and to NCC spokes with no boundary a test could substitute below it, so it could only run against live Google APIs. AWS addressed the same problem in PR #69 with its ec2API seam; this brings that shape to GCP.
The seam lives at the SDK boundary:
The concrete pass-throughs are the only code that touches the SDK; the reconcile logic moves above them with its behavior unchanged, and a fake can now stand in for Google in tests. Unlike ec2API these are semantic seams rather than method-for-method mirrors, because the GCE and NCC clients are fluent builders with no interface to mirror.