cnipodcache

package
v1.8.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CNIConfigInfo

type CNIConfigInfo struct {
	CNIVersion     string
	PodName        string
	PodNameSpace   string
	ContainerID    string
	ContainerNetNS string
	MTU            int
	PodCNIDeleted  bool
	// Uses interface name as a key and the network/CNI config (obtained from network-attachment-definition) as value.
	// NOTE: Interface specific network/CNI config required to be maintained for IPAM clean-up needs.
	NetworkConfig map[string][]byte
}

type CNIPodInfoCache

type CNIPodInfoCache struct {
	// Mutex to protect CNIConfigInfo.PodCNIDeleted which is written by CNIServer, and read by
	// the secondary network Pod controller.
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*CNIPodInfoCache) AddCNIConfigInfo

func (c *CNIPodInfoCache) AddCNIConfigInfo(CNIConfig *CNIConfigInfo)

Add CNIPodInfo to local cache store.

func (*CNIPodInfoCache) DeleteCNIConfigInfo

func (c *CNIPodInfoCache) DeleteCNIConfigInfo(CNIConfig *CNIConfigInfo)

Delete CNIPodInfo from local cache store.

func (*CNIPodInfoCache) GetAllCNIConfigInfoPerPod

func (c *CNIPodInfoCache) GetAllCNIConfigInfoPerPod(podName, podNamespace string) []*CNIConfigInfo

Retrieve all CNIConfigInfo from cacheStore for the given podName and its Namespace NOTE: In an ideal scenario, there should be one cache entry per Pod name and namespace.

func (*CNIPodInfoCache) GetCNIConfigInfoByContainerID

func (c *CNIPodInfoCache) GetCNIConfigInfoByContainerID(podName, podNamespace, containerID string) *CNIConfigInfo

func (*CNIPodInfoCache) GetValidCNIConfigInfoPerPod

func (c *CNIPodInfoCache) GetValidCNIConfigInfoPerPod(podName, podNamespace string) *CNIConfigInfo

Retrieve a valid CNI cache (PodCNIDeleted is not true) entry for the given Pod name and namespace.

func (*CNIPodInfoCache) SetPodCNIDeleted

func (c *CNIPodInfoCache) SetPodCNIDeleted(CNIConfig *CNIConfigInfo)

type CNIPodInfoStore

type CNIPodInfoStore interface {
	AddCNIConfigInfo(cniConfig *CNIConfigInfo)
	DeleteCNIConfigInfo(cniConfig *CNIConfigInfo)
	GetValidCNIConfigInfoPerPod(podName, podNamespace string) *CNIConfigInfo
	GetAllCNIConfigInfoPerPod(podName, podNamespace string) []*CNIConfigInfo
	GetCNIConfigInfoByContainerID(podName, podNamespace, containerID string) *CNIConfigInfo
	SetPodCNIDeleted(CNIConfig *CNIConfigInfo)
}

func NewCNIPodInfoStore

func NewCNIPodInfoStore() CNIPodInfoStore

Jump to

Keyboard shortcuts

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