Skip to content

[improvement] change the subnet-name cache to include the VPC ID in the subnet key - #664

Merged
AshleyDumaine merged 1 commit into
mainfrom
subnet-name-cache
Nov 20, 2026
Merged

AshleyDumaine merged 1 commit into
mainfrom
subnet-name-cache

Conversation

@AshleyDumaine

@AshleyDumaine AshleyDumaine commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

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:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

@github-actions github-actions Bot added the improvement for improvements in existing functionality in the changelog. label Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.73%. Comparing base (e3294d3) to head (d874cf2).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AshleyDumaine
AshleyDumaine marked this pull request as ready for review November 18, 2026 20:53
@AshleyDumaine
AshleyDumaine requested review from a team as code owners November 18, 2026 20:53
@AshleyDumaine
AshleyDumaine enabled auto-merge (squash) November 19, 2026 19:19
@komer3
komer3 requested a lite review from Copilot November 20, 2026 16:48
@AshleyDumaine
AshleyDumaine merged commit adcca2f into main Nov 20, 2026
27 of 29 checks passed
@AshleyDumaine
AshleyDumaine deleted the subnet-name-cache branch November 20, 2026 16:48
Copilot stopped reviewing on behalf of komer3 due to an error November 20, 2026 16:48

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.

🟢 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 SubnetKey and 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement for improvements in existing functionality in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants