Documentation ¶
Index ¶
- func AssignIP(ipamConf types.RangeConfiguration, reservelist []types.IPReservation, ...) (net.IPNet, []types.IPReservation, error)
- func DeallocateIP(reservelist []types.IPReservation, containerID string) ([]types.IPReservation, net.IP)
- func IterateForAssignment(ipnet net.IPNet, rangeStart net.IP, rangeEnd net.IP, ...) (net.IP, []types.IPReservation, error)
- type AssignmentError
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