package allocator

import "github.com/containernetworking/cni/plugins/ipam/host-local/backend/allocator"

Index

Types

type IPAMArgs

type IPAMArgs struct {
	types.CommonArgs
	IP net.IP `json:"ip,omitempty"`
}

type IPAMConfig

type IPAMConfig struct {
	Name       string
	Type       string        `json:"type"`
	RangeStart net.IP        `json:"rangeStart"`
	RangeEnd   net.IP        `json:"rangeEnd"`
	Subnet     types.IPNet   `json:"subnet"`
	Gateway    net.IP        `json:"gateway"`
	Routes     []types.Route `json:"routes"`
	DataDir    string        `json:"dataDir"`
	ResolvConf string        `json:"resolvConf"`
	Args       *IPAMArgs     `json:"-"`
}

IPAMConfig represents the IP related network configuration.

func LoadIPAMConfig

func LoadIPAMConfig(bytes []byte, args string) (*IPAMConfig, string, error)

NewIPAMConfig creates a NetworkConfig from the given network name.

type IPAllocator

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

func NewIPAllocator

func NewIPAllocator(conf *IPAMConfig, store backend.Store) (*IPAllocator, error)

func (*IPAllocator) Get

func (a *IPAllocator) Get(id string) (*current.IPConfig, []*types.Route, error)

Returns newly allocated IP along with its config

func (*IPAllocator) Release

func (a *IPAllocator) Release(id string) error

Releases all IPs allocated for the container with given ID

type Net

type Net struct {
	Name       string      `json:"name"`
	CNIVersion string      `json:"cniVersion"`
	IPAM       *IPAMConfig `json:"ipam"`
}

Source Files

allocator.go config.go

Version
v0.5.0
Published
Mar 6, 2017
Platform
js/wasm
Imports
9 packages
Last checked
17 hours ago

Tools for package owners.