linode-cloud-controller-manager icon indicating copy to clipboard operation
linode-cloud-controller-manager copied to clipboard

Lookup linode by IP instead if label or providerID do not match

Open eljohnson92 opened this issue 2 years ago • 1 comments

General:

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

This change adds a lookupByIP function if a linode cannot be found by label or ID. This means rather that as long as the node and linode share an IP address it will be able to lookup the linode. additionally, we now set the ProviderID based on this lookup if it is not already set so future lookups only need to be made against the ID.

Pull Request Guidelines:

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

eljohnson92 avatar Apr 08 '24 12:04 eljohnson92

one outstanding question here is do we need to be worried about collisions with linode private IPs possibly being the same with customer linodes in different DCs? perhaps we need to restrict it to just the public IP of the linode?

eljohnson92 avatar Apr 08 '24 12:04 eljohnson92