Documentation ¶
Index ¶
- Constants
- type ConfigState
- type ConfigStateCache
- type ConfigStateExecutor
- type NSExecutor
- type NetConf
- type NetStat
- func (c *NetStat) CachePodInterfaceVolatileData(vmi *v1.VirtualMachineInstance, ifaceName string, ...)
- func (c *NetStat) PodInterfaceVolatileDataIsCached(vmi *v1.VirtualMachineInstance, ifaceName string) bool
- func (c *NetStat) Teardown(vmi *v1.VirtualMachineInstance)
- func (c *NetStat) UpdateStatus(vmi *v1.VirtualMachineInstance, domain *api.Domain) error
- type Unpluggedpodnic
- type VMNetworkConfigurator
- func (n *VMNetworkConfigurator) SetupPodNetworkPhase1(launcherPID int, networks []v1.Network, configState ConfigStateExecutor) error
- func (n *VMNetworkConfigurator) SetupPodNetworkPhase2(domain *api.Domain, networks []v1.Network) error
- func (n *VMNetworkConfigurator) UnplugPodNetworksPhase1(vmi *v1.VirtualMachineInstance, networks []v1.Network, ...) error
Constants ¶
const ( DefaultInterfaceQueueCount = 1 UnknownInterfaceQueueCount = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigState ¶ added in v0.59.0
type ConfigState struct {
// contains filtered or unexported fields
}
func NewConfigState ¶ added in v0.59.0
func NewConfigState(configStateCache configStateCacheRUD, ns NSExecutor) ConfigState
func (*ConfigState) Run ¶ added in v0.59.0
func (c *ConfigState) Run(nics []podNIC, preRunFunc func([]podNIC) ([]podNIC, error), discoverFunc func(*podNIC) error, configFunc func(*podNIC) error) error
Run passes through the state machine flow, executing the following steps: - PreRun processes the nics and potentially updates and filters them (e.g. filter-out networks marked for removal). - Discover the current pod network configuration status and persist some of it for future use. - Configure the pod network.
The discovery step can be executed repeatedly with no limitation. The configuration step is allowed to run only once. Any attempt to run it again will cause a critical error.
type ConfigStateCache ¶ added in v1.0.0
type ConfigStateCache struct {
// contains filtered or unexported fields
}
func NewConfigStateCache ¶ added in v1.0.0
func NewConfigStateCache(vmiUID string, cacheCreator cacheCreator) ConfigStateCache
func NewConfigStateCacheWithPodIfaceStateData ¶ added in v1.0.0
func NewConfigStateCacheWithPodIfaceStateData(vmiUID string, cacheCreator cacheCreator, volatilePodIfaceState map[string]cache.PodIfaceState) ConfigStateCache
func (*ConfigStateCache) Delete ¶ added in v1.0.0
func (c *ConfigStateCache) Delete(key string) error
func (*ConfigStateCache) Exists ¶ added in v1.0.0
func (c *ConfigStateCache) Exists(key string) (bool, error)
func (*ConfigStateCache) Read ¶ added in v1.0.0
func (c *ConfigStateCache) Read(key string) (cache.PodIfaceState, error)
func (*ConfigStateCache) Write ¶ added in v1.0.0
func (c *ConfigStateCache) Write(key string, state cache.PodIfaceState) error
type ConfigStateExecutor ¶ added in v1.0.0
type NSExecutor ¶ added in v0.49.0
type NetConf ¶ added in v0.49.0
type NetConf struct {
// contains filtered or unexported fields
}
func NewNetConf ¶ added in v0.49.0
func NewNetConf() *NetConf
func NewNetConfWithCustomFactoryAndConfigState ¶ added in v1.0.0
func NewNetConfWithCustomFactoryAndConfigState(nsFactory nsFactory, cacheCreator cacheCreator, configState map[string]ConfigStateExecutor) *NetConf
type NetStat ¶ added in v0.49.0
type NetStat struct {
// contains filtered or unexported fields
}
func NewNetStat ¶ added in v0.49.0
func NewNetStat() *NetStat
func NewNetStateWithCustomFactory ¶ added in v0.50.0
func NewNetStateWithCustomFactory(cacheCreator cacheCreator) *NetStat
func (*NetStat) CachePodInterfaceVolatileData ¶ added in v0.49.0
func (c *NetStat) CachePodInterfaceVolatileData(vmi *v1.VirtualMachineInstance, ifaceName string, data *cache.PodIfaceCacheData)
func (*NetStat) PodInterfaceVolatileDataIsCached ¶ added in v0.49.0
func (c *NetStat) PodInterfaceVolatileDataIsCached(vmi *v1.VirtualMachineInstance, ifaceName string) bool
func (*NetStat) Teardown ¶ added in v0.49.0
func (c *NetStat) Teardown(vmi *v1.VirtualMachineInstance)
func (*NetStat) UpdateStatus ¶ added in v0.49.0
UpdateStatus calculates the vmi.Status.Interfaces based on the following data sets:
- Pod interface cache: interfaces data (IP/s) collected from the cache (which was populated during the network setup).
- domain.Spec: interfaces configuration as seen by the (libvirt) domain.
- domain.Status.Interfaces: interfaces reported by the guest agent (empty if Qemu agent not running).
- Multus status: Interfaces reported by multus on the pod annotation. The virt-controller updates the VMI interfaces status my setting the infoSource field.
Podnet nic has to be the first one in vmi.Status.Interfaces list to match vmi crd wide columns definition
type Unpluggedpodnic ¶ added in v1.0.0
type Unpluggedpodnic struct {
// contains filtered or unexported fields
}
func NewUnpluggedpodnic ¶ added in v1.0.0
func NewUnpluggedpodnic(vmId string, network v1.Network, handler netdriver.NetworkHandler, launcherPID int, cacheCreator cacheCreator) Unpluggedpodnic
func (Unpluggedpodnic) UnplugPhase1 ¶ added in v1.0.0
func (c Unpluggedpodnic) UnplugPhase1() error
type VMNetworkConfigurator ¶
type VMNetworkConfigurator struct {
// contains filtered or unexported fields
}
func NewVMNetworkConfigurator ¶
func NewVMNetworkConfigurator(vmi *v1.VirtualMachineInstance, cacheCreator cacheCreator, launcherPid *int) *VMNetworkConfigurator
func (*VMNetworkConfigurator) SetupPodNetworkPhase1 ¶
func (n *VMNetworkConfigurator) SetupPodNetworkPhase1(launcherPID int, networks []v1.Network, configState ConfigStateExecutor) error
func (*VMNetworkConfigurator) SetupPodNetworkPhase2 ¶
func (*VMNetworkConfigurator) UnplugPodNetworksPhase1 ¶ added in v1.0.0
func (n *VMNetworkConfigurator) UnplugPodNetworksPhase1(vmi *v1.VirtualMachineInstance, networks []v1.Network, configState ConfigStateExecutor) error