config

package
v0.0.0-...-dd9aec0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Container struct {
		DeviceName          string
		TemporaryDeviceName string
		Namespace           netNS
		Address             DualAddress
		MTU                 int
		Routes              []*types.Route
	}
	Host struct {
		DeviceName string
		Namespace  netNS
		Address    DualAddress
	}
}

func (*Config) AsCNIResult

func (c *Config) AsCNIResult() *current.Result

type ConfigCreator

type ConfigCreator struct {
	HardwareAddressGenerator hardwareAddressGenerator
	DeviceNameGenerator      deviceNameGenerator
	NamespaceAdapter         namespaceAdapter
	Logger                   lager.Logger
}

func (*ConfigCreator) Create

func (c *ConfigCreator) Create(hostNS netNS, addCmdArgs *skel.CmdArgs, ipamResult *current.Result, mtu int) (*Config, error)

type DeviceNameGenerator

type DeviceNameGenerator struct{}

func (*DeviceNameGenerator) GenerateForHost

func (g *DeviceNameGenerator) GenerateForHost(containerIP net.IP) (string, error)

func (*DeviceNameGenerator) GenerateForHostIFB

func (g *DeviceNameGenerator) GenerateForHostIFB(containerIP net.IP) (string, error)

func (*DeviceNameGenerator) GenerateTemporaryForContainer

func (g *DeviceNameGenerator) GenerateTemporaryForContainer(containerIP net.IP) (string, error)

type DualAddress

type DualAddress struct {
	Hardware net.HardwareAddr
	IP       net.IP
}

type HardwareAddressGenerator

type HardwareAddressGenerator struct{}

func (*HardwareAddressGenerator) GenerateForContainer

func (g *HardwareAddressGenerator) GenerateForContainer(containerIP net.IP) (net.HardwareAddr, error)

func (*HardwareAddressGenerator) GenerateForHost

func (g *HardwareAddressGenerator) GenerateForHost(containerIP net.IP) (net.HardwareAddr, error)

type HostLocalIPAM

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

type IPAMConfig

type IPAMConfig struct {
	*Range
	Name       string
	Type       string         `json:"type"`
	Routes     []*types.Route `json:"routes"`
	DataDir    string         `json:"dataDir"`
	ResolvConf string         `json:"resolvConf"`
	Ranges     []RangeSet     `json:"ranges"`
	IPArgs     []net.IP       `json:"-"` // Requested IPs from CNI_ARGS and args
}

type IPAMConfigGenerator

type IPAMConfigGenerator struct{}

func (IPAMConfigGenerator) GenerateConfig

func (IPAMConfigGenerator) GenerateConfig(subnet, network, dataDirPath string) (*HostLocalIPAM, error)

type Range

type Range struct {
	RangeStart net.IP      `json:"rangeStart,omitempty"` // The first ip, inclusive
	RangeEnd   net.IP      `json:"rangeEnd,omitempty"`   // The last ip, inclusive
	Subnet     types.IPNet `json:"subnet"`
	Gateway    net.IP      `json:"gateway,omitempty"`
}

type RangeSet

type RangeSet []Range

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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