cniserver

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOVSPortExternalIDs

func BuildOVSPortExternalIDs(containerConfig *interfacestore.InterfaceConfig) map[string]interface{}

BuildOVSPortExternalIDs parses OVS port external_ids from InterfaceConfig. external_ids are used to compare and sync container interface configuration.

func ParseOVSPortInterfaceConfig

func ParseOVSPortInterfaceConfig(portData *ovsconfig.OVSPortData, portConfig *interfacestore.OVSPortConfig, checkMac bool) *interfacestore.InterfaceConfig

ParseOVSPortInterfaceConfig reads the Pod properties saved in the OVS port external_ids, initializes and returns an InterfaceConfig struct. nill will be returned, if the OVS port does not have external IDs or it is not created for a Pod interface. If "checkMac" param is set as true the ovsExternalIDMAC of portData should be a valid MAC string, otherwise it will print error.

Types

type CNIConfig

type CNIConfig struct {
	*NetworkConfig
	*cnipb.CniCmdArgs
	// contains filtered or unexported fields
}

type CNIServer

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

func New

func New(
	cniSocket, hostProcPathPrefix string,
	nodeConfig *config.NodeConfig,
	kubeClient clientset.Interface,
	isChaining bool,
	routeClient route.Interface,
	networkReadyCh <-chan struct{},
) *CNIServer

func (*CNIServer) CmdAdd

func (s *CNIServer) CmdAdd(ctx context.Context, request *cnipb.CniCmdRequest) (*cnipb.CniCmdResponse, error)

func (*CNIServer) CmdCheck

func (s *CNIServer) CmdCheck(_ context.Context, request *cnipb.CniCmdRequest) (
	*cnipb.CniCmdResponse, error)

func (*CNIServer) CmdDel

func (s *CNIServer) CmdDel(_ context.Context, request *cnipb.CniCmdRequest) (
	*cnipb.CniCmdResponse, error)

func (*CNIServer) Initialize

func (s *CNIServer) Initialize(
	ovsBridgeClient ovsconfig.OVSBridgeClient,
	ofClient openflow.Client,
	ifaceStore interfacestore.InterfaceStore,
	entityUpdates chan<- types.EntityReference,
) error

func (*CNIServer) Run

func (s *CNIServer) Run(stopCh <-chan struct{})

type NetworkConfig

type NetworkConfig struct {
	CNIVersion string          `json:"cniVersion,omitempty"`
	Name       string          `json:"name,omitempty"`
	Type       string          `json:"type,omitempty"`
	DeviceID   string          `json:"deviceID"` // PCI address of a VF
	MTU        int             `json:"mtu,omitempty"`
	DNS        cnitypes.DNS    `json:"dns"`
	IPAM       ipam.IPAMConfig `json:"ipam,omitempty"`
	// Options to be passed in by the runtime.
	RuntimeConfig RuntimeConfig `json:"runtimeConfig"`

	RawPrevResult map[string]interface{} `json:"prevResult,omitempty"`
	PrevResult    cnitypes.Result        `json:"-"`
}

type RuntimeConfig

type RuntimeConfig struct {
	DNS RuntimeDNS `json:"dns"`
}

type RuntimeDNS

type RuntimeDNS struct {
	Nameservers []string `json:"servers,omitempty"`
	Search      []string `json:"searches,omitempty"`
}

Directories

Path Synopsis
testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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