fix(ledger): resolve configured gRPC port in V3GRPCBackendRef - #506
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
be58cb7 to
07bd41d
Compare
✅ Approve — automated reviewThe 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. |
0686df3 to
e5e169c
Compare
…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).
e5e169c to
2c3b378
Compare
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.
…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).
2c3b378 to
226efd6
Compare
…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).
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 CLI • Give Feedback 💬