Skip to content

fix: select node IP by address type#2389

Open
immanuwell wants to merge 1 commit into
microsoft:mainfrom
immanuwell:fix-node-address-selection
Open

fix: select node IP by address type#2389
immanuwell wants to merge 1 commit into
microsoft:mainfrom
immanuwell:fix-node-address-selection

Conversation

@immanuwell

Copy link
Copy Markdown

Description

Tiny follow-up for the node reconciler. If status.addresses has Hostname before InternalIP, Retina used the hostname as the cached node IP. That breaks lookups by the real node IP, kinda sneaky.

Now it picks InternalIP first, then ExternalIP, then any parseable IP. If there is no IP, it logs and skips the cache update.

Related Issue

Related: #1541
Follow-up to #1569

Repro

  1. Reconcile a Node with addresses ordered like this:
    • Hostname: test-node
    • InternalIP: 10.0.0.4
  2. Ask the cache for 10.0.0.4.
  3. Before this fix it returns nil, because the node was cached with test-node. not great

The new test covers this exact case.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...).
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project style.
  • I have added tests.

Testing Completed

go test ./pkg/controllers/daemon/node ./pkg/controllers/cache ./pkg/controllers/daemon/service ./pkg/controllers/daemon/namespace ./pkg/controllers/daemon/metricsconfiguration

Also checked go test ./pkg/controllers/daemon/..., but local envtest is missing /usr/local/kubebuilder/bin/etcd.

@immanuwell immanuwell requested a review from a team as a code owner May 27, 2026 07:58
Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell immanuwell force-pushed the fix-node-address-selection branch from 64e1f78 to 2734b10 Compare May 27, 2026 08:22
@immanuwell

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [company="Immanuel Tikhonov"]

@immanuwell

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@immanuwell

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Immanuel Tikhonov"

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