TPT-4657: Add support for Backend Connectivity and more types in NodeBalancers - #1035
Open
zliang-akamai wants to merge 1 commit into
Open
TPT-4657: Add support for Backend Connectivity and more types in NodeBalancers#1035zliang-akamai wants to merge 1 commit into
zliang-akamai wants to merge 1 commit into
Conversation
zliang-akamai
requested review from
lgarber-akamai and
psnoch-akamai
and removed request for
a team
August 28, 2026 19:09
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the NodeBalancer API surface in linodego by adding backend_connectivity support and expanding the recognized NodeBalancer plan type values, along with corresponding unit/integration test and fixture updates.
Changes:
- Added
BackendConnectivitytoNodeBalancerandNodeBalancerCreateOptions, plusNodeBalancerBackendConnectivityconstants. - Expanded
NodeBalancerPlanTypeconstants to includebasicandenterprise, and documented deprecations for older aliases. - Updated unit/integration tests and fixtures to cover backend connectivity behavior and new response fields.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| nodebalancer.go | Adds BackendConnectivity fields/types and extends plan type constants; updates GetCreateOptions behavior. |
| test/unit/nodebalancer_test.go | Adds unit coverage for backend_connectivity + type parsing and request body serialization. |
| test/unit/nodebalancer_node_test.go | Adds a unit test case for creating a NodeBalancer node with an IPv6 address string. |
| test/unit/fixtures/nodebalancers_list.json | Updates list fixture data to include type and backend_connectivity. |
| test/unit/fixtures/nodebalancer_update.json | Updates update fixture to include type and backend_connectivity. |
| test/unit/fixtures/nodebalancer_node_create_ipv6.json | New fixture for IPv6 node create response. |
| test/unit/fixtures/nodebalancer_get.json | Updates get fixture to include type and backend_connectivity. |
| test/unit/fixtures/nodebalancer_get_with_lke_cluster.json | Updates get-with-lke fixture to include backend_connectivity. |
| test/unit/fixtures/nodebalancer_create.json | Updates create fixture to include type and backend_connectivity. |
| test/unit/fixtures/nodebalancer_create_with_ipv4.json | Updates create-with-IPv4 fixture to include type and backend_connectivity. |
| test/unit/fixtures/nodebalancer_create_with_backend_connectivity.json | New fixture for create response including backend connectivity. |
| test/integration/nodebalancers_test.go | Adds an integration test for creating a premium NodeBalancer with backend connectivity set to IPv6. |
| test/integration/fixtures/TestNodeBalancer_Create_BackendConnectivity_Premium.yaml | New VCR fixture for the new backend connectivity integration test. |
Suppressed comments (4)
test/unit/nodebalancer_test.go:137
- This assertion dereferences nodebalancer.BackendConnectivity without checking for nil, which can panic if the API/fixture omits backend_connectivity.
assert.Equal(t, linodego.NBTypeCommon, nodebalancer.Type)
assert.Equal(t, linodego.NBBackendConnectivityUndefined, *nodebalancer.BackendConnectivity)
test/unit/nodebalancer_test.go:175
- These assertions dereference nodebalancers[1].BackendConnectivity without a nil check, which can panic if backend_connectivity is omitted in the response.
assert.Equal(t, linodego.NBTypePremium, nodebalancers[1].Type)
assert.Equal(t, linodego.NBBackendConnectivityIPv6, *nodebalancers[1].BackendConnectivity)
test/unit/nodebalancer_test.go:208
- This assertion dereferences nodebalancer.BackendConnectivity without checking for nil, which can panic if backend_connectivity is omitted in the update response fixture/API.
assert.Equal(t, linodego.NBTypeCommon, nodebalancer.Type)
assert.Equal(t, linodego.NBBackendConnectivityLegacy, *nodebalancer.BackendConnectivity)
test/unit/nodebalancer_test.go:166
- These assertions dereference nodebalancers[0].BackendConnectivity without a nil check. Since BackendConnectivity is optional, this can panic if the field is omitted in the response.
assert.Equal(t, linodego.NBTypeCommon, nodebalancers[0].Type)
assert.Equal(t, linodego.NBBackendConnectivityUndefined, *nodebalancers[0].BackendConnectivity)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+73
to
+80
| if tt.createOpts.Type != "" { | ||
| assert.Equal(t, tt.createOpts.Type, nodebalancer.Type) | ||
| } | ||
| if tt.createOpts.BackendConnectivity != nil { | ||
| assert.Equal(t, *tt.createOpts.BackendConnectivity, *nodebalancer.BackendConnectivity) | ||
| } else { | ||
| assert.Equal(t, linodego.NBBackendConnectivityUndefined, *nodebalancer.BackendConnectivity) | ||
| } |
Comment on lines
+122
to
+131
| // NBTypeBasic is the default plan. Clients do not have to specify this value. | ||
| NBTypeBasic NodeBalancerPlanType = "basic" | ||
|
|
||
| // NBTypeEnterprise supports up to 40Gbps bandwidth. | ||
| NBTypeEnterprise NodeBalancerPlanType = "enterprise" | ||
|
|
||
| // NBTypeCommon is the default plan. Clients do not have to specify this value. | ||
| // | ||
| // Deprecated: NBTypeCommon will be replaced by NBTypeBasic. | ||
| NBTypeCommon NodeBalancerPlanType = "common" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add support for Backend Connectivity and more types in NodeBalancers, IPv6 support not included.
✔️ How to Test
make TEST_ARGS="-run TestNodeBalancer_Create_BackendConnectivity_Premium" test-int