Repository navigation
[improvement] change the subnet-name cache to include the VPC ID in the subnet key - #664
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #664 +/- ##
==========================================
+ Coverage 82.65% 82.73% +0.07%
==========================================
Files 19 19
Lines 2618 2629 +11
==========================================
+ Hits 2164 2175 +11
Misses 454 454 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AshleyDumaine
marked this pull request as ready for review
November 18, 2026 20:53
AshleyDumaine
force-pushed
the
subnet-name-cache
branch
from
November 19, 2026 14:56
617e00a to
48bdda9
Compare
AshleyDumaine
enabled auto-merge (squash)
November 19, 2026 19:19
komer3
approved these changes
Nov 20, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the change addresses subnet-cache collisions by scoping keys to both VPC ID and subnet name with corresponding test coverage.
No open issues 🎉
What changed in this PR
This pull request prevents subnet-cache collisions when identically named subnets exist in different VPCs by using a composite VPC ID and subnet name cache key.
Changes:
- Introduces
SubnetKeyand updates subnet cache lookups and writes. - Updates affected production tests and fixtures to use VPC-aware subnet keys.
- Adds coverage for identical subnet names across different VPCs.
| File | Description |
|---|---|
| cloud/nodeipam/ipam/cloud_allocator_test.go | Updates NodeIPAM test cache initialization to use the composite subnet key. |
| cloud/linode/services/vpc.go | Defines the composite subnet key and applies it to subnet cache lookups and writes. |
| cloud/linode/services/vpc_test.go | Updates cache fixtures and adds coverage for same-name subnets in different VPCs. |
| cloud/linode/route_controller_test.go | Updates route-controller subnet cache fixtures to include the VPC ID. |
| cloud/linode/nodebalancer_backend_range_test.go | Updates NodeBalancer subnet cache fixtures to use VPC-aware keys. |
| cloud/linode/fake_linode_test.go | Updates fake client cache initialization for the new subnet key type. |
| cloud/linode/cloud_test.go | Updates cloud-provider test fixtures for composite subnet cache keys. |
Review effort: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
We want to avoid potential cache collisions by keying off both the VPC ID and the subnet name, not just the subnet name. This is relevant for NodeBalancers provisioned in the same cluster but using different VPCs via annotations.
General:
Pull Request Guidelines: