8000 refactor(bridge): move 3P wrapper reconciliation out of reconciler.go by VLukiantsev · Pull Request #1011 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

refactor(bridge): move 3P wrapper reconciliation out of reconciler.go - #1011

Merged
VLukiantsev merged 1 commit into
refactor/bridge-split-cms-proberfrom
refactor/bridge-split-wrapper
Oct 2, 2026
Merged

VLukiantsev merged 1 commit into
refactor/bridge-split-cms-proberfrom
refactor/bridge-split-wrapper

Conversation

@VLukiantsev
@VLukiantsev VLukiantsev commented Sep 28, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Part 3/4 of the pure-move stack splitting pkg/components/bridge/reconciler.go. This PR moves the 3P wrapper and operator-less (Profile 3) reconciliation path into wrapper_reconciler.go, along with its tests. There are no behaviour, API or naming changes.

Motivation & Context

This implements the wrapper_reconciler.go file from the layout agreed in the #992 review.

Review with: git diff --color-moved=dimmed-zebra origin/refactor/bridge-split-cms-prober...origin/refactor/bridge-split-wrapper

Key Changes

  • wrapper_reconciler.go: resolveAndValidateWrapperRef, resolveOperatorlessEndpoint, reconcile3PWrapper, reconcile3PWrapperFallback, reconcileOperatorlessWrapper, verifyEndpointHealth, handle3PUnreadyStatus, handle3PReadyStatus, populateAccessEnvVars.
  • wrapper_reconciler_test.go: TestReconcileComponent_3PWrapperAdvanced, TestReconcile3PWrapper_CrossNamespaceForbidden, TestPopulateAccessEnvVars, TestReconcile_OperatorlessProfile3, TestResolveOperatorlessEndpointAndIPv6.
  • Removed the reflect import from reconciler_test.go, which the move left unused.

Assumptions

  • TestResolveOperatorlessEndpointAndIPv6 moved intact, even though it also asserts two bridge_prober.go helpers (resolveProbeEndpoint, resolveConnectionEndpoint). Splitting it would change test code, which is out of scope for a pure move — impact if wrong: a small follow-up to split it.
  • verify3PStatusDetectorAssertions and assertCoordinateEnvVars stay in reconciler_test.go because only the mixed TestReconcileComponent_Scenarios table uses them.

Verification & Testing

  • Commands Executed: bazel test //pkg/components/bridge:bridge_test, ./.githooks/pre-commit
  • Coverage & Test Status: all tests pass and the test count is unchanged (106). The sorted added-vs-deleted line diff shows only license/package/import boilerplate.

Related Issues / Bugs

Follow-up to the #992 review.

TAG=agy
CONV=25ae2278-aa0f-44db-af8a-4f9deda0d399

Third of four pure-move layers splitting pkg/components/bridge/reconciler.go
by responsibility, following the file layout agreed in the #992
review.

- wrapper_reconciler.go: the 3P wrapper and operator-less (Profile 3) path:
  resolveAndValidateWrapperRef, resolveOperatorlessEndpoint,
  reconcile3PWrapper, reconcile3PWrapperFallback,
  reconcileOperatorlessWrapper, verifyEndpointHealth,
  handle3PUnreadyStatus, handle3PReadyStatus and populateAccessEnvVars.
- wrapper_reconciler_test.go: TestReconcileComponent_3PWrapperAdvanced,
  TestReconcile3PWrapper_CrossNamespaceForbidden, TestPopulateAccessEnvVars,
  TestReconcile_OperatorlessProfile3 and
  TestResolveOperatorlessEndpointAndIPv6 (moved intact; it also covers two
  prober endpoint helpers).
- Drop the now-unused reflect import from reconciler_test.go.

No renames, no behaviour or public API changes.

Review with: git diff --color-moved=dimmed-zebra

TAG=agy
CONV=25ae2278-aa0f-44db-af8a-4f9deda0d399
@VLukiantsev
VLukiantsev added this pull request to stack #1013 September 28, 2026 16:01
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the codebase by moving third-party wrapper reconciliation logic and its associated tests from reconciler.go and reconciler_test.go into dedicated files, wrapper_reconciler.go and wrapper_reconciler_test.go. The feedback highlights two improvement opportunities in the newly created wrapper_reconciler.go: simplifying a redundant endpoint check in reconcile3PWrapper and removing dead code in reconcile3PWrapperFallback where a nil check is performed on a prober that is already guaranteed to be nil.

@AntonTyb AntonTyb left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

as usual - feels like more logs could be added...

@VLukiantsev
VLukiantsev added this pull request to the merge queue Oct 2, 2026
Merged via the queue into main with commit 3c02b31 Oct 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0