allocate

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignIP

func AssignIP(ipamConf types.RangeConfiguration, reservelist []types.IPReservation, containerID, podRef, ifName string) (net.IPNet, []types.IPReservation, error)

AssignIP assigns an IP using a range and a reserve list.

func DeallocateIP

func DeallocateIP(reservelist []types.IPReservation, containerID string) ([]types.IPReservation, net.IP)

DeallocateIP removes allocation from reserve list. Returns the updated reserve list and the deallocated IP.

func IterateForAssignment

func IterateForAssignment(ipnet net.IPNet, rangeStart net.IP, rangeEnd net.IP, reserveList []types.IPReservation, excludeRanges []string, containerID, podRef, ifName string) (net.IP, []types.IPReservation, error)

IterateForAssignment iterates given an IP/IPNet and a list of reserved IPs and exluded subnets. Valid IPs are contained within the ipnet, excluding the network and broadcast address. If rangeStart is specified, it is respected if it lies within the ipnet. If rangeEnd is specified, it is respected if it lies within the ipnet and if it is >= rangeStart. reserveList holds a list of reserved IPs. excludeRanges holds a list of subnets to be excluded (meaning the full subnet, including the network and broadcast IP).

Types

type AssignmentError

type AssignmentError struct {
	// contains filtered or unexported fields
}

AssignmentError defines an IP assignment error.

func (AssignmentError) Error

func (a AssignmentError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL