Skip to content

Bugfix: VPC api call failures could cause deletion of all nodes#570

Open
akaokunc wants to merge 2 commits into
linode:mainfrom
akaokunc:bugfix/vpc-api-call-failure-could-lead-to-nodes-deletion
Open

Bugfix: VPC api call failures could cause deletion of all nodes#570
akaokunc wants to merge 2 commits into
linode:mainfrom
akaokunc:bugfix/vpc-api-call-failure-could-lead-to-nodes-deletion

Conversation

@akaokunc
Copy link
Copy Markdown
Contributor

Hello, I was trying find a bug in cooperation between linode LKE api provider and linode CCM to explain unexpected behavior which I have seen on few clusters. I'm not sure I found the root cause of the issue I was observing, but I do believe I have found at least related one.

Here's the possible failure chain:

  1. GetVPCIPAddresses or GetVPCIPv6Addresses returns error, that error would only be logged but the node will be skipped on writing to cache, due to condition:
if len(options.Options.VPCNames) > 0 && len(vpcNodes[instance.ID]) == 0 {
    continue  // instance skipped — vpcNodes is empty due to the failed API call
}
  1. InstanceExists returns false, nil for every node, because linodeByID finds nothing in the empty cache and returns cloudprovider.InstanceNotFound which InstanceExists converts to false, nil.

  2. The cache is written with an empty map and lastUpdate is stamped nc.nodes = newNodes; nc.lastUpdate = time.Now(), so the bad data persists for the full TTL period (default 15s).

  3. The K8s node lifecycle controller deletes such nodes.

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. [n] 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. [n] Have you linked your PR to an open issue

@akaokunc akaokunc temporarily deployed to prod-external May 13, 2026 08:01 — with GitHub Actions Inactive
@akaokunc akaokunc force-pushed the bugfix/vpc-api-call-failure-could-lead-to-nodes-deletion branch from fcb7710 to 0adb33b Compare May 15, 2026 07:59
@akaokunc akaokunc temporarily deployed to prod-external May 15, 2026 08:00 — with GitHub Actions Inactive
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.63%. Comparing base (fd29af4) to head (2fc95f7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #570      +/-   ##
==========================================
+ Coverage   73.31%   73.63%   +0.32%     
==========================================
  Files          19       19              
  Lines        2960     2958       -2     
==========================================
+ Hits         2170     2178       +8     
+ Misses        532      525       -7     
+ Partials      258      255       -3     

☔ View full report in Codecov by Sentry.
📢 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant