Version: v0.0.0-...-9649b88 Latest Latest

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 12 Imported by: 0




This section is empty.


View Source
var DeleteFromDB = func(db dbaccessor.DbAccessor, portObj *portobj.PortObj) error {
	interfaceID := portObj.LazyAttr.ID + portObj.EagerAttr.PodNs + portObj.EagerAttr.PodName
	keyPortInNetwork := dbaccessor.GetKeyOfInterfaceInNetwork(portObj.LazyAttr.TenantID,
		portObj.LazyAttr.NetAttr.ID, interfaceID)
	err := db.DeleteLeaf(keyPortInNetwork)
	if err != nil {
		klog.Errorf("PortRole.DeleteFromDB: etcd.DeleteLeaf error! -%v", err)
	urlinterfacesport := dbaccessor.GetKeyOfInterface(portObj.LazyAttr.TenantID, interfaceID)
	err = db.DeleteDir(urlinterfacesport)
	if err != nil {
		klog.Errorf("PortRole.DeleteFromDB: etcd.DeleteDir error! -%v", err)

	agtObj := cni.GetGlobalContext()
	urlPaasInterfaceForNode := dbaccessor.GetKeyOfPaasInterfaceForNode(agtObj.ClusterID, agtObj.HostIP, interfaceID)
	err = agtObj.DB.DeleteLeaf(urlPaasInterfaceForNode)
	if err != nil {
		klog.Errorf("PortRole.DeleteFromDB: agtObj.DB.DeleteLeaf(urlPaasInterfaceForNode) error! -%v", err)

	keyPortInPod := dbaccessor.GetKeyOfInterfaceInPod(portObj.LazyAttr.TenantID,
		portObj.LazyAttr.ID, portObj.EagerAttr.PodNs, portObj.EagerAttr.PodName)
	klog.Infof("PortRole:keyPortInPod:", keyPortInPod)
	err = agtObj.DB.DeleteLeaf(keyPortInPod)
	if err != nil {
		klog.Errorf("PortRole: DeleteLeaf keyPortInPod error! -%v", err)
	return nil


This section is empty.


type PodBuilderRole

type PodBuilderRole struct {
	PodID    string
	PodType  string
	PortObjs []*portobj.PortObj

func (*PodBuilderRole) AnalyzeV2PodNetTemplate

func (this *PodBuilderRole) AnalyzeV2PodNetTemplate(podNs, podName string, Ports []*monitor.Port) ([]*portobj.PortObj,

func (*PodBuilderRole) GetPodType

func (this *PodBuilderRole) GetPodType(portList []*portobj.PortObj) string

func (*PodBuilderRole) Transform

func (this *PodBuilderRole) Transform(podNs, podName string, pod *monitor.Pod) error

type PodDataRole

type PodDataRole struct {
	PodID         string
	PodType       string
	PodName       string
	PodNs         string
	TenantID      string
	HostType      string
	VnicType      string
	VMID          string
	C0ContainerID string

type PortRole

type PortRole struct {
	// contains filtered or unexported fields

func (*PortRole) Attach

func (this *PortRole) Attach(cniObj *cni.CniParam, port *manager.Port, vethNameOfPod string) (*bind.Dpdknic, error)

func (*PortRole) Init

func (this *PortRole) Init(podDataRole *PodDataRole)

func (*PortRole) StoreToDB

func (this *PortRole) StoreToDB(db dbaccessor.DbAccessor, mport *manager.Port,
	portObj *portobj.PortObj, businfo string) error

Jump to

Keyboard shortcuts

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