kubernetesk8s.io/kubernetes/pkg/controller/node/ipam/cidrset Index | Files

package cidrset

import "k8s.io/kubernetes/pkg/controller/node/ipam/cidrset"

Index

Variables

var (
	// ErrCIDRRangeNoCIDRsRemaining occurs when there are no more space
	// to allocate CIDR ranges.
	ErrCIDRRangeNoCIDRsRemaining = errors.New(
		"CIDR allocation failed; there are no remaining CIDRs left to allocate in the accepted range")
)

Types

type CidrSet

type CidrSet struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CidrSet manages a set of CIDR ranges from which blocks of IPs can be allocated from.

func NewCIDRSet

func NewCIDRSet(clusterCIDR *net.IPNet, subNetMaskSize int) *CidrSet

NewCIDRSet creates a new CidrSet.

func (*CidrSet) AllocateNext

func (s *CidrSet) AllocateNext() (*net.IPNet, error)

AllocateNext allocates the next free CIDR range. This will set the range as occupied and return the allocated range.

func (*CidrSet) Occupy

func (s *CidrSet) Occupy(cidr *net.IPNet) (err error)

Occupy marks the given CIDR range as used. Occupy does not check if the CIDR range was previously used.

func (*CidrSet) Release

func (s *CidrSet) Release(cidr *net.IPNet) error

Release releases the given CIDR range.

Source Files

cidr_set.go

Version
v1.8.2
Published
Oct 24, 2017
Platform
linux/amd64
Imports
6 packages
Last checked
12 minutes ago

Tools for package owners.