Skip to content

fix(envtest): default NLBTargetType to ip in suite reconciler#373

Merged
bdchatham merged 1 commit into
mainfrom
fix/envtest-default-nlb-target-type
May 30, 2026
Merged

fix(envtest): default NLBTargetType to ip in suite reconciler#373
bdchatham merged 1 commit into
mainfrom
fix/envtest-default-nlb-target-type

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

Summary

PR #372 introduced SEI_NLB_TARGET_TYPE with default-resolution centralised in cmd/main.go — the reconciler's NLBTargetType field is canonical, no per-reconcile fallback. The envtest suite (internal/controller/nodedeployment/envtest/suite_test.go) is a parallel "main" that constructs its own SeiNodeDeploymentReconciler and doesn't read the env var, so it landed with NLBTargetType: "".

Result: generateP2PEndpointService stamped the target-type annotation with the empty string, and TestP2PEndpointP2P_CreateWithTCP_ChildHasAddressAndServiceExists failed asserting aws-load-balancer-nlb-target-type=ip.

Fix

One-line: set NLBTargetType: nodedeploymentcontroller.DefaultNLBTargetType in the envtest suite, mirroring the cmd/main.go invariant.

Verification

make test-integration passes locally with this change.

Note on the ECR image at 6a4334e (PR #372 merge commit)

The ECR workflow built successfully despite the CI failure (separate workflow, doesn't gate on tests). The production code path is unaffected — cmd/main.go correctly defaults to ip. Only the envtest scaffolding was missing the same default. The image 6a4334e184ddbd34f183611b8824ad29559c19e3 is safe to deploy as-is.

🤖 Generated with Claude Code

PR #372 moved SEI_NLB_TARGET_TYPE default-resolution to cmd/main.go so
the reconciler treats Spec.NLBTargetType as canonical. The envtest
suite_test.go is a parallel "main" that constructs its own reconciler
and never reads the env var — it was left with NLBTargetType="" after
the rebase, which stamped an empty target-type annotation on the
generated Service and broke
TestP2PEndpointP2P_CreateWithTCP_ChildHasAddressAndServiceExists.

Apply the same default in the envtest suite so it mirrors cmd/main.go's
construction-site invariant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 30, 2026

PR Summary

Low Risk
Test-only wiring in the envtest suite; no production controller or deployment path changes.

Overview
After PR #372, SeiNodeDeploymentReconciler.NLBTargetType is set from SEI_NLB_TARGET_TYPE in cmd/main.go (default ip) with no in-reconciler fallback. The envtest suite builds its own reconciler and left NLBTargetType empty, so P2P endpoint Services got a blank aws-load-balancer-nlb-target-type annotation and integration tests expecting ip failed.

The change sets NLBTargetType to nodedeploymentcontroller.DefaultNLBTargetType in suite_test.go, aligning envtest with the production default. Runtime behavior outside tests is unchanged.

Reviewed by Cursor Bugbot for commit eef22f3. Bugbot is set up for automated code reviews on this repo. Configure here.

@bdchatham bdchatham merged commit 458c637 into main May 30, 2026
5 checks passed
@bdchatham bdchatham deleted the fix/envtest-default-nlb-target-type branch May 30, 2026 01:34
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.

1 participant