Documentation ¶
Index ¶
- Constants
- func GenerateNetworkID(network *v1.NetworkSelectionElement) string
- func GeneratePodNetworkID(pod *kapi.Pod, networkID string) string
- func GetPodNetwork(networks []*v1.NetworkSelectionElement, networkName string) (*v1.NetworkSelectionElement, error)
- func GetPodNetworkGUID(network *v1.NetworkSelectionElement) (string, error)
- func HasNetworkAttachmentAnnot(pod *kapi.Pod) bool
- func IsPodNetworkConfiguredWithInfiniBand(network *v1.NetworkSelectionElement) bool
- func ParseNetworkID(networkID string) (string, string, error)
- func ParsePKey(pKey string) (int, error)
- func PodIsRunning(pod *kapi.Pod) bool
- func PodNetworkHasGUID(network *v1.NetworkSelectionElement) bool
- func PodScheduled(pod *kapi.Pod) bool
- func PodWantsNetwork(pod *kapi.Pod) bool
- func SetPodNetworkGUID(network *v1.NetworkSelectionElement, guid string, setAsRuntimeConfig bool) error
- type IbSriovCniSpec
- type SynchronizedMap
Constants ¶
const ( InfiniBandAnnotation = "mellanox.infiniband.app" ConfiguredInfiniBandPod = "configured" InfiniBandSriovCni = "ib-sriov" )
Variables ¶
This section is empty.
Functions ¶
func GenerateNetworkID ¶ added in v1.0.1
func GenerateNetworkID(network *v1.NetworkSelectionElement) string
GenerateNetworkID returns the network name and network namespace with . separation
func GeneratePodNetworkID ¶ added in v1.0.1
func GetPodNetwork ¶
func GetPodNetwork(networks []*v1.NetworkSelectionElement, networkName string) (*v1.NetworkSelectionElement, error)
func GetPodNetworkGUID ¶ added in v1.0.1
func GetPodNetworkGUID(network *v1.NetworkSelectionElement) (string, error)
GetPodNetworkGUID return network cni-args guid field
func HasNetworkAttachmentAnnot ¶ added in v1.0.1
HasNetworkAttachmentAnnot check if pod has Network Attachment Annotation
func IsPodNetworkConfiguredWithInfiniBand ¶
func IsPodNetworkConfiguredWithInfiniBand(network *v1.NetworkSelectionElement) bool
IsPodNetworkConfiguredWithInfiniBand check if pod is already InfiniBand supported
func ParseNetworkID ¶ added in v1.0.1
ParseNetworkID returns the network name and network namespace
func PodIsRunning ¶
PodIsRunning check if pod is in "Running" state
func PodNetworkHasGUID ¶ added in v1.0.1
func PodNetworkHasGUID(network *v1.NetworkSelectionElement) bool
PodNetworkHasGUID check if network cni-args has guid field
func PodScheduled ¶
PodScheduled check if pod is assigned to node
func PodWantsNetwork ¶
PodWantsNetwork check if pod needs cni
func SetPodNetworkGUID ¶ added in v1.0.1
func SetPodNetworkGUID(network *v1.NetworkSelectionElement, guid string, setAsRuntimeConfig bool) error
SetPodNetworkGUID set network cni-args guid
Types ¶
type IbSriovCniSpec ¶
type IbSriovCniSpec struct { Type string `json:"type"` PKey string `json:"pkey"` Capabilities map[string]bool `json:"capabilities,omitempty"` }
func GetIbSriovCniFromNetwork ¶
func GetIbSriovCniFromNetwork(networkSpec map[string]interface{}) (*IbSriovCniSpec, error)
GetIbSriovCniFromNetwork check if network uses IB-SR-IOV-CNi
type SynchronizedMap ¶
type SynchronizedMap struct { Items map[string]interface{} sync.RWMutex // Read Write mutex, guards access to internal map. }
SynchronizedMap a thread safe string to anything map
func NewSynchronizedMap ¶
func NewSynchronizedMap() *SynchronizedMap
NewSynchronizedMap creates a new synchronized map
func (*SynchronizedMap) Get ¶
func (m *SynchronizedMap) Get(key string) (interface{}, bool)
Get retrieves an element from map under given key
func (*SynchronizedMap) Remove ¶
func (m *SynchronizedMap) Remove(key string)
Remove removes an element from the map
func (*SynchronizedMap) Set ¶
func (m *SynchronizedMap) Set(key string, value interface{})
Set sets the given value under the specified key
func (*SynchronizedMap) UnSafeRemove ¶
func (m *SynchronizedMap) UnSafeRemove(key string)
UnSafeRemove removes an element from the map without lock
func (*SynchronizedMap) UnSafeSet ¶
func (m *SynchronizedMap) UnSafeSet(key string, value interface{})
UnSafeSet sets the given value under the specified key without lock