types

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultLeaderLeaseDuration    = 1500
	DefaultLeaderRenewDeadline    = 1000
	DefaultLeaderRetryPeriod      = 500
	AddTimeLimit                  = 2 * time.Minute
	DelTimeLimit                  = 1 * time.Minute
	DefaultOverlappingIPsFeatures = true
	DefaultSleepForRace           = 0
)

Datastore types

View Source
const (
	// Allocate operation identifier
	Allocate = 0
	// Deallocate operation identifier
	Deallocate = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	AddressStr string `json:"address"`
	Gateway    net.IP `json:"gateway,omitempty"`
	Address    net.IPNet
	Version    string
}

Address is our standard address.

type IPAMConfig

type IPAMConfig struct {
	Name                     string
	Type                     string               `json:"type"`
	Routes                   []*cnitypes.Route    `json:"routes"`
	Addresses                []Address            `json:"addresses,omitempty"`
	IPRanges                 []RangeConfiguration `json:"ipRanges"`
	OmitRanges               []string             `json:"exclude,omitempty"`
	DNS                      cnitypes.DNS         `json:"dns"`
	Range                    string               `json:"range"`
	RangeStart               net.IP               `json:"range_start,omitempty"`
	RangeEnd                 net.IP               `json:"range_end,omitempty"`
	GatewayStr               string               `json:"gateway"`
	LeaderLeaseDuration      int                  `json:"leader_lease_duration,omitempty"`
	LeaderRenewDeadline      int                  `json:"leader_renew_deadline,omitempty"`
	LeaderRetryPeriod        int                  `json:"leader_retry_period,omitempty"`
	LogFile                  string               `json:"log_file"`
	LogLevel                 string               `json:"log_level"`
	ReconcilerCronExpression string               `json:"reconciler_cron_expression,omitempty"`
	OverlappingRanges        bool                 `json:"enable_overlapping_ranges,omitempty"`
	SleepForRace             int                  `json:"sleep_for_race,omitempty"`
	Gateway                  net.IP
	Kubernetes               KubernetesConfig `json:"kubernetes,omitempty"`
	ConfigurationPath        string           `json:"configuration_path"`
	PodName                  string
	PodNamespace             string
	NetworkName              string `json:"network_name,omitempty"`
}

IPAMConfig describes the expected json configuration for this plugin

func (*IPAMConfig) GetPodRef added in v0.6.1

func (ic *IPAMConfig) GetPodRef() string

func (*IPAMConfig) UnmarshalJSON added in v0.6.1

func (ic *IPAMConfig) UnmarshalJSON(data []byte) error

type IPAMEnvArgs

type IPAMEnvArgs struct {
	cnitypes.CommonArgs
	IP                         cnitypes.UnmarshallableString `json:"ip,omitempty"`
	GATEWAY                    cnitypes.UnmarshallableString `json:"gateway,omitempty"`
	K8S_POD_NAME               cnitypes.UnmarshallableString //revive:disable-line
	K8S_POD_NAMESPACE          cnitypes.UnmarshallableString //revive:disable-line
	K8S_POD_INFRA_CONTAINER_ID cnitypes.UnmarshallableString //revive:disable-line
}

IPAMEnvArgs are the environment vars we expect

type IPReservation

type IPReservation struct {
	IP          net.IP `json:"ip"`
	ContainerID string `json:"id"`
	PodRef      string `json:"podref,omitempty"`
	IsAllocated bool
}

IPReservation is an address that has been reserved by this plugin

func (IPReservation) String

func (ir IPReservation) String() string

type KubernetesConfig

type KubernetesConfig struct {
	KubeConfigPath string `json:"kubeconfig,omitempty"`
	K8sAPIRoot     string `json:"k8s_api_root,omitempty"`
}

KubernetesConfig describes the kubernetes-specific configuration details

type Net

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

Net is The top-level network config - IPAM plugins are passed the full configuration of the calling plugin, not just the IPAM section.

type NetConfList added in v0.5.3

type NetConfList struct {
	CNIVersion string `json:"cniVersion,omitempty"`

	Name         string `json:"name,omitempty"`
	DisableCheck bool   `json:"disableCheck,omitempty"`
	Plugins      []*Net `json:"plugins,omitempty"`
}

NetConfList describes an ordered list of networks.

type RangeConfiguration added in v0.6.1

type RangeConfiguration struct {
	OmitRanges []string `json:"exclude,omitempty"`
	Range      string   `json:"range"`
	RangeStart net.IP   `json:"range_start,omitempty"`
	RangeEnd   net.IP   `json:"range_end,omitempty"`
}

Jump to

Keyboard shortcuts

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