Documentation ¶
Index ¶
- Constants
- Variables
- func NewGenericPlugin(helpers helper.HostHelpersInterface, options ...Option) (plugin.VendorPlugin, error)
- type DriverState
- type DriverStateMapType
- type GenericPlugin
- func (p *GenericPlugin) Apply() error
- func (p *GenericPlugin) CheckStatusChanges(current *sriovnetworkv1.SriovNetworkNodeState) (bool, error)
- func (p *GenericPlugin) Name() string
- func (p *GenericPlugin) OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeState) (needDrain bool, needReboot bool, err error)
- func (p *GenericPlugin) Spec() string
- type Option
Constants ¶
const ( Vfio = iota VirtioVdpa VhostVdpa )
driver id
Variables ¶
var PluginName = "generic"
Functions ¶
func NewGenericPlugin ¶ added in v1.2.0
func NewGenericPlugin(helpers helper.HostHelpersInterface, options ...Option) (plugin.VendorPlugin, error)
Initialize our plugin and set up initial values
Types ¶
type DriverState ¶ added in v1.3.0
type DriverStateMapType ¶ added in v1.3.0
type DriverStateMapType map[uint]*DriverState
type GenericPlugin ¶
type GenericPlugin struct { PluginName string SpecVersion string DesireState *sriovnetworkv1.SriovNetworkNodeState DriverStateMap DriverStateMapType DesiredKernelArgs map[string]bool // contains filtered or unexported fields }
func (*GenericPlugin) CheckStatusChanges ¶ added in v1.3.0
func (p *GenericPlugin) CheckStatusChanges(current *sriovnetworkv1.SriovNetworkNodeState) (bool, error)
CheckStatusChanges verify whether SriovNetworkNodeState CR status present changes on configured VFs.
func (*GenericPlugin) Name ¶
func (p *GenericPlugin) Name() string
Name returns the name of the plugin
func (*GenericPlugin) OnNodeStateChange ¶
func (p *GenericPlugin) OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeState) (needDrain bool, needReboot bool, err error)
OnNodeStateChange Invoked when SriovNetworkNodeState CR is created or updated, return if need drain and/or reboot node
func (*GenericPlugin) Spec ¶
func (p *GenericPlugin) Spec() string
Spec returns the version of the spec expected by the plugin
type Option ¶ added in v1.3.0
type Option = func(c *genericPluginOptions)
func WithSkipBridgeConfiguration ¶ added in v1.4.0
func WithSkipBridgeConfiguration() Option
WithSkipBridgeConfiguration configures generic_plugin to skip configuration of the managed bridges
func WithSkipVFConfiguration ¶ added in v1.3.0
func WithSkipVFConfiguration() Option
WithSkipVFConfiguration configures generic plugin to skip configuration of the VFs. In this case PFs will be configured and VFs are created only, VF configuration phase is skipped. VFs on the PF (if the PF is not ExternallyManaged) will have no driver after the plugin execution completes.