Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] handle cases where the internal-ip is already set (e.g. kubelet) #236

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

AshleyDumaine
Copy link
Member

@AshleyDumaine AshleyDumaine commented Oct 1, 2024

Related to #111

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

In the case that a Node's internal IP is already set (e.g. to a VLAN IP), the CCM will fail to set the external IP for the Node:

E1001 18:20:24.780329       1 node_controller.go:240] error syncing 'foo-control-plane-kxlgm': failed to get node modifiers from cloud provider: provided node ip for node "foo-control-plane-kxlgm" is not valid: failed to get node address from cloud provider that matches ip: 10.0.0.1, requeuing

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.50%. Comparing base (42e3341) to head (ff4c10f).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
+ Coverage   56.43%   56.50%   +0.06%     
==========================================
  Files          12       12              
  Lines        1887     1890       +3     
==========================================
+ Hits         1065     1068       +3     
  Misses        672      672              
  Partials      150      150              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AshleyDumaine AshleyDumaine force-pushed the internal-ip branch 2 times, most recently from 20dee87 to a777899 Compare October 2, 2024 16:00
Copy link
Contributor

@rosskirkpat rosskirkpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if addr.Type == v1.NodeInternalIP {
addresses = append(addresses, v1.NodeAddress{Type: v1.NodeInternalIP, Address: addr.Address})
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make sure same ip is not already present in the slice? For example, if this InstanceMetadata() gets called again after 5-10 mins, then we'll end up adding all the existing ip's again into the slice. Not sure if k8s automatically handles such case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@rahulait rahulait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@AshleyDumaine AshleyDumaine merged commit d37c425 into main Oct 2, 2024
5 checks passed
@AshleyDumaine AshleyDumaine deleted the internal-ip branch October 2, 2024 18:38
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.

3 participants