Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #773 +/- ##
==========================================
+ Coverage 62.83% 63.16% +0.33%
==========================================
Files 71 71
Lines 7178 7292 +114
==========================================
+ Hits 4510 4606 +96
- Misses 2401 2415 +14
- Partials 267 271 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for allocating IPv6 /64 CIDRs to Linodes by introducing ipv6Range fields for VPCs and subnets, validating their format in webhooks, and propagating the allocated ranges through controllers and instance configurations.
- Define new
IPv6RangeandIPv6fields in the LinodeVPC and subnet specs/types, with generated deep-copy methods. - Extend webhook validation (
validateIPv6Range) and add unit tests for correct/incorrect IPv6 range formats. - Update controller helpers and machine interface logic to reconcile, create, and apply actual IPv6 ranges, plus corresponding test and documentation updates.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/webhook/v1alpha2/linodevpc_webhook.go | Added validateIPv6Range function and invoked it for VPC & subnets |
| internal/webhook/v1alpha2/linodevpc_webhook_test.go | New unit tests covering valid and invalid IPv6Range values |
| internal/controller/linodevpc_controller_helpers.go | Populate Spec.IPv6 from API responses and map IPv6Range to create options |
| internal/controller/linodemachine_controller_helpers.go | Generate IPv6 interface config based on subnet ranges |
| api/v1alpha2/linodevpc_types.go & zz_generated.deepcopy.go | Introduce VPCCreateOptionsIPv6, VPCSubnetCreateOptionsIPv6, and new spec fields |
| config/crd/bases/..._linodevpcs.yaml | Extend CRD schema with ipv6 and ipv6Range fields |
| docs/src/reference/out.md | Add reference docs for ipv6 and ipv6Range in VPC and subnets |
| go.mod | Bump linodego dependency to version supporting IPv6 ranges |
Comments suppressed due to low confidence (1)
config/crd/bases/infrastructure.cluster.x-k8s.io_linodevpcs.yaml:85
- [nitpick] Consider adding an OpenAPI validation (e.g., a regex pattern or
x-kubernetes-validations) for theipv6Rangefield to enforce the '/' or 'auto' format at the API level, instead of relying solely on the webhook.
ipv6Range:
There was a problem hiding this comment.
Pull Request Overview
Adds IPv6 /64 CIDR allocation support to Linode VPCs by extending API types, validation, controller logic, and documentation.
- Introduce
IPv6andIPv6Rangefields inLinodeVPCSpecandVPCSubnetCreateOptions, with CRD schema and deepcopy support. - Implement
validateIPv6Rangein the webhook to enforce correct/prefixorautovalues, and add corresponding tests. - Extend controller helpers and machine interface configuration to propagate allocated IPv6 ranges into VPCs, subnets, and instance interfaces; update tests and bump
linodegodependency. - Add documentation snippets for the new fields in
docs/src/reference/out.md.
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/webhook/v1alpha2/linodevpc_webhook_test.go | Added test cases for invalid and valid IPv6Range values |
| internal/webhook/v1alpha2/linodevpc_webhook.go | Added validateIPv6Range and wired IPv6Range validation |
| internal/controller/linodevpc_controller_helpers.go | Refactored reconciliation to set IPv6 in VPC and subnets |
| internal/controller/linodevpc_controller_test.go | Updated VPC lifecycle tests to assert IPv6 ranges |
| internal/controller/linodemachine_controller_helpers.go | Inject IPv6 ranges into machine interface config |
| internal/controller/linodemachine_controller_helpers_test.go | Added tests for IPv6 in interface configuration |
| api/v1alpha2/linodevpc_types.go | Defined IPv6 and IPv6Range fields in API types |
| api/v1alpha2/zz_generated.deepcopy.go | Generated deepcopy methods for new IPv6-related types |
| config/crd/bases/infrastructure.cluster.x-k8s.io_linodevpcs.yaml | Extended CRD schema with IPv6 and IPv6Range properties |
| docs/src/reference/out.md | Documented new IPv6 and IPv6Range fields in reference docs |
| go.mod | Bumped github.com/linode/linodego to include IPv6 support |
Comments suppressed due to low confidence (2)
docs/src/reference/out.md:1082
- [nitpick] Add a note in the Default column clarifying that omitting
ipv6Rangeresults in no IPv6 allocation (or defaults to 'auto' behavior if intended) to help users understand the default behavior.
| `ipv6Range` _[VPCCreateOptionsIPv6](#vpccreateoptionsipv6) array_ | IPv6Range is a list of IPv6 ranges to allocate to the VPC.<br />If not specified, the VPC will not have an IPv6 range allocated.<br />Once ranges are allocated, they will be added to the IPv6 field. | | |
config/crd/bases/infrastructure.cluster.x-k8s.io_linodevpcs.yaml:96
- [nitpick] Consider adding an OpenAPI validation (e.g.,
x-kubernetes-validations) for theipv6Range[].rangeproperty to enforce valid formats ('auto' or '/') at the schema level and prevent invalid values earlier.
properties:
There was a problem hiding this comment.
Not wild about the field names, but we're following the existing naming convention from https://techdocs.akamai.com/linode-api/reference/post-vpc and https://github.com/linode/linodego/blob/proj/vpc-dual-stack/vpc_subnet.go so looks good to me 👍
What this PR does / why we need it:
NOTE: This uses a beta feature which is not yet available in production. Once the supported APIs are enabled in production, this feature can be used. IPv6 range allocation is disabled by default and can be enabled on request.
This PR will enable linodes to get a /64 ipv6 cidr allocated to them by linode API. It adds IPv6 /64 CIDR allocation support to Linode VPCs by extending API types, validation, controller logic, and documentation.
The PR does:
ipv6 CIDRs are allocated to VPCs, subnets within VPCs and then to linodes attached to subnets which have ipv6 cidr ranges.
Following config (
ipv6Range) can be added to LinodeVPC and its subnets to have ipv6 ranges allocated to VPC:Instead of "auto", one can also specify the prefix length preceded by "/" ( like "/52").
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
TODOs: