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

IPAM multipool followups #26138

Merged
merged 4 commits into from
Jun 14, 2023

Commits on Jun 14, 2023

  1. ipam/allocator: merge NodeEventHandler.{Create,Update}

    NodeEventHandler.Create already calls NodeEventHandler.Update in all
    existing implementations. Thus, remove the Create method and rename
    Update to Upsert which more clearly describes its purpose.
    
    Also remove the unused (*Node).Update method instead of converting it to
    call NodeEventHandler.Upsert. It's never called anywhere and not needed
    to satisfy an interface.
    
    Signed-off-by: Tobias Klauser <tobias@cilium.io>
    tklauser committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    7043f24 View commit details
    Browse the repository at this point in the history
  2. ipam/allocator: remove unused NodeEventHandler.Upsert bool return value

    Signed-off-by: Tobias Klauser <tobias@cilium.io>
    tklauser committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    997dd38 View commit details
    Browse the repository at this point in the history
  3. ip, ipam/allocator: replace ip.PrefixToIPNet with netipx.PrefixIPNet

    ip.PrefixToIPNet implements the same functionality as the
    netipx.PrefixIPNet function in the go4.org/netipx dependency that is
    already vendored. Use it instead of maintaining our own copy.
    
    Signed-off-by: Tobias Klauser <tobias@cilium.io>
    tklauser committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    133afd6 View commit details
    Browse the repository at this point in the history
  4. ipam/allocator/multipool: avoid parsing CIDRs multiple times

    In (*PoolAllocator).updateCIDRSets the CIDRs are currently parsed twice,
    once using netip.ParsePrefix and once using net.ParseCIDR. Avoid this
    and pass the CIDRs as []netip.Prefix and at the same time also convert
    downstream functions in ipam/cidrset to take a netip.Prefix instead of
    *net.IPNet.
    
    Ref. cilium#25824 (comment)
    Ref. cilium#25991 (comment)
    
    Signed-off-by: Tobias Klauser <tobias@cilium.io>
    tklauser committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    250e80c View commit details
    Browse the repository at this point in the history