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
Convert daemon ipcache usages to new ipcache async API #25749
Convert daemon ipcache usages to new ipcache async API #25749
Conversation
/test |
2074178
to
efddbe6
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one non-blocking note.
0232093
to
1699b2b
Compare
Switch over from using direct ipcache insertion with raw identities to a label-based model, see GH-21142. Signed-off-by: Chris Tarazi <chris@isovalent.com>
This will be useful going forward when wanting to convert net.IPNet prefixes to netip.Prefix. Signed-off-by: Chris Tarazi <chris@isovalent.com>
Move to the new async ipcache API, see GH-21142. Signed-off-by: Chris Tarazi <chris@isovalent.com>
1699b2b
to
f868917
Compare
/test |
} else { | ||
log.WithError(err).Warning("could not restore Ingress IP, a new one will be allocated") | ||
} | ||
d.ipcache.UpsertLabels( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that this can not fail any more :-)
// IPNetToPrefix is a convenience helper for migrating from the older 'net' | ||
// standard library types to the newer 'netip' types. Use this to plug the | ||
// new types in newer code into older types in older code during the migration. | ||
func IPNetToPrefix(prefix *net.IPNet) netip.Prefix { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this equivalent to netipx.FromStdIPNet
(sans the additional bool
return). Given that we already vendor that library I wonder whether we could use that conversion function instead of adding our own conversion helper?
Also ref. #24246 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I forgot about this. Sending a PR to revert and fixup the use of net
pkg. Thanks for catching this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related: #21142