Add FrontendVPCs support to NodeBalancers#857
Add FrontendVPCs support to NodeBalancers#857komer3 wants to merge 6 commits intolinode:proj/frontend-vpcsfrom
Conversation
- Add `FrontendAddressType` and `FrontendVPCSubnetID` fields to `NodeBalancer` struct - Add `FrontendVPCs` field to `NodeBalancerCreateOptions` struct - Add clarifying comment to `IPv4RangeAutoAssign` field in `NodeBalancerVPCOptions`
There was a problem hiding this comment.
Pull request overview
This PR adds support for frontend VPC configuration to NodeBalancers, enabling VPC-based frontend addressing alongside the existing backend VPC support. The changes introduce new fields to track frontend VPC subnet information and allow frontend VPC specification during NodeBalancer creation.
Key changes:
- Added
FrontendAddressTypeandFrontendVPCSubnetIDfields to track frontend VPC configuration - Added
FrontendVPCsoption to enable frontend VPC specification during creation - Clarified that
IPv4RangeAutoAssignapplies only to backend VPC configuration
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fb0a239 to
8a0a88c
Compare
| FrontendAddressType *string `json:"frontend_address_type,omitempty"` | ||
| // Frontend VPC subnet ID when using VPC addressing | ||
| FrontendVPCSubnetID *int `json:"frontend_vpc_subnet_id,omitempty"` |
There was a problem hiding this comment.
If they are not nullable, can we have them as non-pointer types?
| SubnetID int `json:"subnet_id"` | ||
| // IPv4RangeAutoAssign is only used for backend VPC configuration. | ||
| // For frontend VPCs, this field is ignored. | ||
| IPv4RangeAutoAssign bool `json:"ipv4_range_auto_assign,omitempty"` |
There was a problem hiding this comment.
Couldn't find this attribute in the API spec doc. Is the doc outdated?
There was a problem hiding this comment.
That field was part of backend VPC support for NB!
nodebalancer.go
Outdated
| @@ -61,4 +61,4 @@ | |||
There was a problem hiding this comment.
If these fields are optional, can we have them as pointer types?
There was a problem hiding this comment.
Yeah, makes sense to me!
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| IPv4 *string `json:"ipv4"` | ||
| // This NodeBalancer's public IPv6 address. | ||
| IPv6 *string `json:"ipv6"` | ||
| // Frontend address type (Either "vpc" or "public") |
There was a problem hiding this comment.
Comment should start with the field name for consistency with Go documentation conventions. Should be: 'FrontendAddressType is the frontend address type (either "vpc" or "public")'.
| // Frontend address type (Either "vpc" or "public") | |
| // FrontendAddressType is the frontend address type (either "vpc" or "public"). |
| IPv6 *string `json:"ipv6"` | ||
| // Frontend address type (Either "vpc" or "public") | ||
| FrontendAddressType *string `json:"frontend_address_type,omitempty"` | ||
| // Frontend VPC subnet ID when using VPC addressing |
There was a problem hiding this comment.
Comment should start with the field name for consistency with Go documentation conventions. Should be: 'FrontendVPCSubnetID is the VPC subnet ID when using VPC addressing for the frontend'.
| // Frontend VPC subnet ID when using VPC addressing | |
| // FrontendVPCSubnetID is the VPC subnet ID when using VPC addressing for the frontend |
| IPv4Range *string `json:"ipv4_range,omitempty"` | ||
| IPv6Range *string `json:"ipv6_range,omitempty"` | ||
| SubnetID int `json:"subnet_id"` |
There was a problem hiding this comment.
Changing IPv4Range and IPv6Range from string to *string is a breaking API change that could affect existing users of this struct. Consider the impact on backwards compatibility.
| IPv4Range *string `json:"ipv4_range,omitempty"` | |
| IPv6Range *string `json:"ipv6_range,omitempty"` | |
| SubnetID int `json:"subnet_id"` | |
| IPv4Range string `json:"ipv4_range,omitempty"` | |
| IPv6Range string `json:"ipv6_range,omitempty"` | |
| SubnetID int `json:"subnet_id"` |
FrontendAddressTypeandFrontendVPCSubnetIDfields toNodeBalancerstructFrontendVPCsfield toNodeBalancerCreateOptionsstructIPv4RangeAutoAssignfield inNodeBalancerVPCOptions📝 Description
What does this PR do and why is this change necessary?
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
How do I run the relevant unit/integration tests?
📷 Preview
If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.