Skip to content

fix(ledger): resolve configured gRPC port in V3GRPCBackendRef - #506

Merged
Dav-14 merged 1 commit into
fix/connectivity-gate-teardownfrom
fix/ledger-grpc-port
Aug 6, 2026
Merged

fix(ledger): resolve configured gRPC port in V3GRPCBackendRef#506
Dav-14 merged 1 commit into
fix/connectivity-gate-teardownfrom
fix/ledger-grpc-port

Conversation

@Dav-14

@Dav-14 Dav-14 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

V3GRPCBackendRef, the single source of truth consumed by the
connectivity module to build its ledgerAddress, always passed port 0 to
ledgerV3GRPCBackendRef and therefore assumed the default gRPC port. The
gateway backend (v3.go / v3_preview.go) instead resolves the port from
the stack LedgerConfiguration (spec.cluster.service.grpcPort), so a stack
overriding the ledger Cluster gRPC service port got a Connectivity
pointed at the wrong port while the gateway stayed correct.

Resolve the configured port from the LedgerConfiguration inside
V3GRPCBackendRef (via ledgerV3BaseSpec, the same base the gateway derives
its clusterSpec from) so both consumers honour the override and fall back
to the default port when unset. Thread the reconciler Context through the
export and its connectivity caller.

Add a table-driven unit test covering default, stack-scoped, wildcard,
and precedence cases.


Stack created with GitHub Stacks CLIGive Feedback 💬

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7e5708c-a76f-4bd0-9198-28fcefb63787

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Dav-14
Dav-14 force-pushed the fix/ledger-grpc-port branch from be58cb7 to 07bd41d Compare August 3, 2026 08:46

@flemzord flemzord left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

@Dav-14
Dav-14 marked this pull request as ready for review August 3, 2026 14:53
@Dav-14
Dav-14 requested a review from a team as a code owner August 3, 2026 14:53
@NumaryBot

NumaryBot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

✅ Approve — automated review

The fix correctly resolves the configured gRPC port via LedgerConfiguration in V3GRPCBackendRef, with proper context and error propagation. The added tests cover default, scoped, wildcard, and precedence cases. No blocking or major issues were identified by any reviewer, and there are no new findings beyond what was already addressed in prior discussion.

No findings.

@Dav-14
Dav-14 force-pushed the fix/ledger-grpc-port branch 2 times, most recently from 0686df3 to e5e169c Compare August 3, 2026 15:24
Dav-14 added a commit that referenced this pull request Aug 3, 2026
…tworkPolicy

The allow-ledger-v3-from-connectivity policy hardcoded port 8888, so a
stack overriding spec.cluster.service.grpcPort had its connectivity gRPC
traffic silently denied by the default-ingress policy — even though #506
makes the client dial the configured port.

Resolve the effective port from ledgers.V3GRPCBackendRef (the same source
of truth the client uses, honoring the LedgerConfiguration override and
falling back to the default) instead of the constant. Add a test covering
the override alongside the default (raised in review of #507).
@Dav-14
Dav-14 force-pushed the fix/ledger-grpc-port branch from e5e169c to 2c3b378 Compare August 3, 2026 15:46
V3GRPCBackendRef, the single source of truth consumed by the
connectivity module to build its ledgerAddress, always passed port 0 to
ledgerV3GRPCBackendRef and therefore assumed the default gRPC port. The
gateway backend (v3.go / v3_preview.go) instead resolves the port from
the stack LedgerConfiguration (spec.cluster.service.grpcPort), so a stack
overriding the ledger Cluster gRPC service port got a Connectivity
pointed at the wrong port while the gateway stayed correct.

Resolve the configured port from the LedgerConfiguration inside
V3GRPCBackendRef (via ledgerV3BaseSpec, the same base the gateway derives
its clusterSpec from) so both consumers honour the override and fall back
to the default port when unset. Thread the reconciler Context through the
export and its connectivity caller.

Add a table-driven unit test covering default, stack-scoped, wildcard,
and precedence cases.
Dav-14 added a commit that referenced this pull request Aug 3, 2026
…tworkPolicy

The allow-ledger-v3-from-connectivity policy hardcoded port 8888, so a
stack overriding spec.cluster.service.grpcPort had its connectivity gRPC
traffic silently denied by the default-ingress policy — even though #506
makes the client dial the configured port.

Resolve the effective port from ledgers.V3GRPCBackendRef (the same source
of truth the client uses, honoring the LedgerConfiguration override and
falling back to the default) instead of the constant. Add a test covering
the override alongside the default (raised in review of #507).
@Dav-14
Dav-14 force-pushed the fix/ledger-grpc-port branch from 2c3b378 to 226efd6 Compare August 3, 2026 16:03
Dav-14 added a commit that referenced this pull request Aug 3, 2026
…tworkPolicy

The allow-ledger-v3-from-connectivity policy hardcoded port 8888, so a
stack overriding spec.cluster.service.grpcPort had its connectivity gRPC
traffic silently denied by the default-ingress policy — even though #506
makes the client dial the configured port.

Resolve the effective port from ledgers.V3GRPCBackendRef (the same source
of truth the client uses, honoring the LedgerConfiguration override and
falling back to the default) instead of the constant. Add a test covering
the override alongside the default (raised in review of #507).
@Dav-14
Dav-14 merged commit 9efca42 into feat/connectivity-module Aug 6, 2026
13 of 22 checks passed
@Dav-14
Dav-14 deleted the fix/ledger-grpc-port branch August 6, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants