plugin

package
v0.0.0-...-1a511a4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8S_POD_NAMESPACE          = "K8S_POD_NAMESPACE"
	K8S_POD_NAME               = "K8S_POD_NAME"
	K8S_POD_INFRA_CONTAINER_ID = "K8S_POD_INFRA_CONTAINER_ID"
	K8S_POD_UID                = "K8S_POD_UID"
)

Variables

This section is empty.

Functions

func ConfigureIface

func ConfigureIface(ifName string, ipConfigs []*current.IPConfig, routes []*types.Route) error

func GenerateNetworkResultByNic

func GenerateNetworkResultByNic(index int, nic PodNic, defaultGw bool) (*current.Result, error)

func GenerateNetworkResultByNics

func GenerateNetworkResultByNics(nics []PodNic) (*current.Result, error)

func GetCloudServerDir

func GetCloudServerDir() string

func Main

func Main(version string)

Types

type CloudPod

type CloudPod struct {
	*PodInfo
	// contains filtered or unexported fields
}

func NewCloudPodFromCNIArgs

func NewCloudPodFromCNIArgs(args string) (*CloudPod, error)

func (CloudPod) GetDesc

func (p CloudPod) GetDesc() *PodDesc

type NetConf

type NetConf struct {
	types.NetConf
}

type OVSClient

type OVSClient interface {
	AddPort(bridge, port string) error
	DeletePort(bridge, port string) error
}

func NewOVSClient

func NewOVSClient() (OVSClient, error)

type PodDesc

type PodDesc struct {
	Id     string   `json:"id"`
	Name   string   `json:"name"`
	Status string   `json:"status"`
	Nics   []PodNic `json:"nics"`
}

type PodInfo

type PodInfo struct {
	Id          string
	Name        string
	Namespace   string
	ContainerId string
}

func NewPodInfoFromCNIArgs

func NewPodInfoFromCNIArgs(args string) (*PodInfo, error)

func (PodInfo) GetDescPath

func (p PodInfo) GetDescPath() string

type PodNic

type PodNic struct {
	Index     int    `json:"index"`
	Bridge    string `json:"bridge"`
	Ifname    string `json:"ifname"`
	Interface string `json:"interface"`
	Ip        string `json:"ip"`
	Mac       string `json:"mac"`
	Gateway   string `json:"gateway"`
	Bandwidth int    `json:"bw"`
	Dns       string `json:"dns"`
	Mtu       int    `json:"mtu"`
	Masklen   int    `json:"masklen,omitempty"`
	Domain    string `json:"domain,omitempty"`
	NetId     string `json:"net_id"`
	WireId    string `json:"wire_id"`
}

func (PodNic) GetInterface

func (n PodNic) GetInterface(idx int) string

Jump to

Keyboard shortcuts

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