Skip to content

TPT-4657: Add support for Backend Connectivity and more types in NodeBalancers - #1035

Open
zliang-akamai wants to merge 1 commit into
linode:mainfrom
zliang-akamai:zhiwei/premium-nb-ipv4-type-backend-conn
Open

TPT-4657: Add support for Backend Connectivity and more types in NodeBalancers#1035
zliang-akamai wants to merge 1 commit into
linode:mainfrom
zliang-akamai:zhiwei/premium-nb-ipv4-type-backend-conn

Conversation

@zliang-akamai

Copy link
Copy Markdown
Member

📝 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

Copilot AI lite review requested due to automatic review settings August 28, 2026 19:09
@zliang-akamai
zliang-akamai requested review from a team as code owners August 28, 2026 19:09
@zliang-akamai
zliang-akamai requested review from lgarber-akamai and psnoch-akamai and removed request for a team August 28, 2026 19:09
@zliang-akamai zliang-akamai changed the title Add support for Backend Connectivity and more types in NodeBalancers TPT-1234: Add support for Backend Connectivity and more types in NodeBalancers Aug 28, 2026
@zliang-akamai zliang-akamai changed the title TPT-1234: Add support for Backend Connectivity and more types in NodeBalancers TPT-4657: Add support for Backend Connectivity and more types in NodeBalancers Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 BackendConnectivity to NodeBalancer and NodeBalancerCreateOptions, plus NodeBalancerBackendConnectivity constants.
  • Expanded NodeBalancerPlanType constants to include basic and enterprise, 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 thread nodebalancer.go
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"
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