Skip to content

Fix VPC interface addresses flattening#408

Merged
zliang-akamai merged 3 commits intodevfrom
zhiwei/fix-vpc-interface
Mar 5, 2026
Merged

Fix VPC interface addresses flattening#408
zliang-akamai merged 3 commits intodevfrom
zhiwei/fix-vpc-interface

Conversation

@zliang-akamai
Copy link
Member

@zliang-akamai zliang-akamai commented Mar 5, 2026

📝 Description

Fix the issue that NAT 1 to 1 address is not included in creation options after being flattened.

Bug report is from a comment under another issue: #222 (comment)

✔️ How to Test

make unit-test

@zliang-akamai zliang-akamai requested a review from a team as a code owner March 5, 2026 01:43
@zliang-akamai zliang-akamai requested review from mawilk90 and mgwoj and removed request for a team March 5, 2026 01:43
@mgwoj mgwoj requested a review from Copilot March 5, 2026 13:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes missing VPC interface IPv4 address fields during request option flattening so 1:1 NAT addresses (and primary flag) are preserved when creating Linode interfaces.

Changes:

  • Update flattenVPCInterface to include Primary and NAT1To1Address when mapping IPv4 addresses.
  • Add a new unit test file covering flattenVPCInterface, flattenPublicInterface, flattenLinodeInterface, flattenConfigInterface(IPv4), and flattenMetadata.
  • Strengthen disk/config flattening tests (DeepEqual for table cases + new “all fields” coverage, plus expanded flattenInstanceConfig assertions).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
builder/linode/step_create_linode.go Ensures VPC IPv4 address create options include Primary and NAT1To1Address during flattening.
builder/linode/step_create_linode_test.go Adds focused unit coverage validating interface/metadata flattening behavior (incl. NAT 1:1 mapping).
builder/linode/step_create_disk_config_test.go Improves test assertions for disk/config flattening and adds broader “all fields” coverage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

Tests passed locally!

@zliang-akamai zliang-akamai merged commit 137de92 into dev Mar 5, 2026
12 checks passed
@zliang-akamai zliang-akamai deleted the zhiwei/fix-vpc-interface branch March 5, 2026 19:03
@yec-akamai yec-akamai added the bugfix for any bug fixes in the changelog. label Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix for any bug fixes in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants