Skip to content

TPT-4603: Added support for NAT Service - #1033

Open
ezilber-akamai wants to merge 2 commits into
linode:proj/nat-service-for-vpcfrom
ezilber-akamai:TPT-4603-support-nat-service
Open

TPT-4603: Added support for NAT Service#1033
ezilber-akamai wants to merge 2 commits into
linode:proj/nat-service-for-vpcfrom
ezilber-akamai:TPT-4603-support-nat-service

Conversation

@ezilber-akamai

Copy link
Copy Markdown
Contributor

📝 Description

Added support and unit tests for NAT Service for VPC.

✔️ How to Test

make test-unit

@ezilber-akamai
ezilber-akamai requested review from a team as code owners August 28, 2026 13:22
@ezilber-akamai ezilber-akamai added the new-feature for new features in the changelog. label Aug 28, 2026
@ezilber-akamai
ezilber-akamai requested review from lgarber-akamai and psnoch-akamai and removed request for a team August 28, 2026 13:22
@ezilber-akamai ezilber-akamai changed the title Added support for NAT Service TPT-4603: Added support for NAT Service 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

Adds VPC NAT Gateway support to the client and related resource models.

Changes:

  • Adds NAT Gateway models and client operations.
  • Exposes NAT Gateway data on subnets, interfaces, IPs, and regions.
  • Adds fixture-backed unit coverage.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
nat_gateways.go Adds NAT Gateway API support.
regions.go Adds the regional capability.
vpc_subnet.go Adds subnet NAT Gateway fields and options.
interfaces.go Adds interface NAT Gateway data.
instance_ips.go Adds VPC IP NAT Gateway data.
test/unit/nat_gateways_test.go Tests NAT Gateway operations.
test/unit/vpc_test.go Tests NAT Gateway subnet creation.
test/unit/vpc_subnets_test.go Tests subnet NAT Gateway responses.
test/unit/vpc_ips_test.go Tests VPC IP NAT Gateway data.
test/unit/interface_test.go Tests interface NAT Gateway data.
test/unit/fixtures/vpc_subnets_list.json Adds list response data.
test/unit/fixtures/vpc_subnet_update.json Adds update response data.
test/unit/fixtures/vpc_subnet_get.json Adds get response data.
test/unit/fixtures/vpc_subnet_create.json Adds create response data.
test/unit/fixtures/vpc_specific_ips_list.json Adds scoped IP response data.
test/unit/fixtures/vpc_ips_list.json Adds IP list response data.
test/unit/fixtures/nat_gateways_update.json Adds update fixture.
test/unit/fixtures/nat_gateways_list.json Adds list fixture.
test/unit/fixtures/nat_gateways_list_interfaces.json Adds interface list fixture.
test/unit/fixtures/nat_gateways_list_addresses.json Adds address list fixture.
test/unit/fixtures/nat_gateways_list_address_interfaces.json Adds address-interface fixture.
test/unit/fixtures/nat_gateways_get.json Adds get fixture.
test/unit/fixtures/nat_gateways_get_types.json Adds type fixture.
test/unit/fixtures/nat_gateways_get_settings.json Adds settings fixture.
test/unit/fixtures/nat_gateways_get_address.json Adds address fixture.
test/unit/fixtures/nat_gateways_create.json Adds create fixture.
test/unit/fixtures/nat_gateways_add_address.json Adds address creation fixture.
test/unit/fixtures/interface_list.json Adds interface association data.
Suppressed comments (5)

vpc_subnet.go:68

  • GetCreateOptions was not updated for this newly writable field, so converting a returned subnet back to create options silently drops its NAT gateway ID. Populate the option from the response model and extend the conversion assertion to cover it.
	NATGateway *VPCSubnetCreateOptionsNATGateway `json:"natgateway,omitzero"`

nat_gateways.go:49

  • Repository guidance requires optional create/update fields to use omitzero (AGENTS.md:40). Keep this new options type consistent; for a pointer this retains the same omission behavior while using the required tag.
	Label *string `json:"label,omitempty"`

nat_gateways.go:122

  • This exported update signature reverses the established ID-before-options order used by UpdateVPCSubnet, UpdateVolume, and other ID-scoped updates. Define it as (ctx, id, opts) now; correcting the ordering after release would require a breaking API change.
func (c *Client) UpdateNATGateway(ctx context.Context, opts NATGatewayUpdateOptions, id int) (*NATGateway, error) {

nat_gateways.go:134

  • The subordinate public methods switch from the file's verb-first naming (ListNATGateways, GetNATGateway) to NATGateway<Action>, and place options before the gateway ID. Rename this family consistently—for example, AddNATGatewayAddress(ctx, id, opts), ListNATGatewayAddresses(ctx, id, opts), and GetNATGatewaySettings—before the API is released.
func (c *Client) NATGatewayAddAddress(ctx context.Context, opts NATGatewayAddAddressOptions, id int) (*NATGatewayAddressObject, error) {

nat_gateways.go:133

  • Correct the typo in the exported method documentation.
// NATGatewayAddAddress adds an addresd to the NAT Gateway with the specified id

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread vpc_subnet.go
Databases []VPCSubnetDatabase `json:"databases"`
Nodebalancers []VPCSubnetNodebalancers `json:"nodebalancers"`

NATGateway VPCSubnetNATGateway `json:"natgateway"`
Comment thread interfaces.go
Ranges []VPCInterfaceIPv4Range `json:"ranges"`
Addresses []VPCInterfaceIPv4Address `json:"addresses"`
Ranges []VPCInterfaceIPv4Range `json:"ranges"`
NATGateway VPCInterfaceIPv4NATGateway `json:"natgateway"`
Comment thread instance_ips.go
// The type of this field will be made a pointer in the next major release of linodego.
ConfigID int `json:"config_id"`
ConfigID int `json:"config_id"`
NATGateway VPCIPNATGateway `json:"natgateway"`
Comment thread nat_gateways.go
Comment on lines +18 to +19
Created *time.Time `json:"-"`
Updated *time.Time `json:"-"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants