sriov

package
v0.0.0-...-d31edc8 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanAllNetworkNodePolicies

func CleanAllNetworkNodePolicies(
	apiClient *clients.Settings, operatornsname string, options ...metav1.ListOptions) error

CleanAllNetworkNodePolicies removes all SriovNetworkNodePolicies that are not set as default.

func CleanAllNetworksByTargetNamespace

func CleanAllNetworksByTargetNamespace(
	apiClient *clients.Settings,
	operatornsname string,
	targetnsname string,
	options ...metav1.ListOptions) error

CleanAllNetworksByTargetNamespace deletes all networks matched by their NetworkNamespace spec.

func CleanAllPoolConfigs

func CleanAllPoolConfigs(
	apiClient *clients.Settings, operatornsname string) error

CleanAllPoolConfigs removes all sriovNetworkPoolConfigs.

func GetSriovNetworksGVR

func GetSriovNetworksGVR() schema.GroupVersionResource

GetSriovNetworksGVR returns SriovNetwork's GroupVersionResource which could be used for Clean function.

Types

type NetworkAdditionalOptions

type NetworkAdditionalOptions func(builder *NetworkBuilder) (*NetworkBuilder, error)

NetworkAdditionalOptions additional options for SriovNetwork object.

type NetworkBuilder

type NetworkBuilder struct {
	// srIovNetwork definition. Used to create srIovNetwork object.
	Definition *srIovV1.SriovNetwork
	// Created srIovNetwork object.
	Object *srIovV1.SriovNetwork
	// contains filtered or unexported fields
}

NetworkBuilder provides struct for srIovNetwork object which contains connection to cluster and srIovNetwork definition.

func List

func List(apiClient *clients.Settings, nsname string, options ...metav1.ListOptions) ([]*NetworkBuilder, error)

List returns sriov networks in the given namespace.

func NewNetworkBuilder

func NewNetworkBuilder(
	apiClient *clients.Settings, name, nsname, targetNsname, resName string) *NetworkBuilder

NewNetworkBuilder creates new instance of Builder.

func PullNetwork

func PullNetwork(apiClient *clients.Settings, name, nsname string) (*NetworkBuilder, error)

PullNetwork pulls existing sriovnetwork from cluster.

func (*NetworkBuilder) Create

func (builder *NetworkBuilder) Create() (*NetworkBuilder, error)

Create generates SrIovNetwork in a cluster and stores the created object in struct.

func (*NetworkBuilder) Delete

func (builder *NetworkBuilder) Delete() error

Delete removes SrIovNetwork object.

func (*NetworkBuilder) Exists

func (builder *NetworkBuilder) Exists() bool

Exists checks whether the given SrIovNetwork object exists in a cluster.

func (*NetworkBuilder) Update

func (builder *NetworkBuilder) Update(force bool) (*NetworkBuilder, error)

Update renovates the existing SrIovNetwork object with the SrIovNetwork definition in builder.

func (*NetworkBuilder) WithIPAddressSupport

func (builder *NetworkBuilder) WithIPAddressSupport() *NetworkBuilder

WithIPAddressSupport sets ips capabilities in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithLinkState

func (builder *NetworkBuilder) WithLinkState(linkState string) *NetworkBuilder

WithLinkState sets linkState parameters in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithMacAddressSupport

func (builder *NetworkBuilder) WithMacAddressSupport() *NetworkBuilder

WithMacAddressSupport sets mac capabilities in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithMaxTxRate

func (builder *NetworkBuilder) WithMaxTxRate(maxTxRate uint16) *NetworkBuilder

WithMaxTxRate sets maxTxRate parameters in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithMetaPluginAllMultiFlag

func (builder *NetworkBuilder) WithMetaPluginAllMultiFlag(allMultiFlag bool) *NetworkBuilder

WithMetaPluginAllMultiFlag metaplugin activates allmulti multicast mode on a SriovNetwork configuration.

func (*NetworkBuilder) WithMinTxRate

func (builder *NetworkBuilder) WithMinTxRate(minTxRate uint16) *NetworkBuilder

WithMinTxRate sets minTxRate parameters in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithOptions

func (builder *NetworkBuilder) WithOptions(options ...NetworkAdditionalOptions) *NetworkBuilder

WithOptions creates SriovNetwork with generic mutation options.

func (*NetworkBuilder) WithSpoof

func (builder *NetworkBuilder) WithSpoof(enabled bool) *NetworkBuilder

WithSpoof sets spoof flag based on the given argument in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithStaticIpam

func (builder *NetworkBuilder) WithStaticIpam() *NetworkBuilder

WithStaticIpam sets static IPAM in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithTrustFlag

func (builder *NetworkBuilder) WithTrustFlag(enabled bool) *NetworkBuilder

WithTrustFlag sets trust flag based on the given argument in the SrIoVNetwork definition spec.

func (*NetworkBuilder) WithVLAN

func (builder *NetworkBuilder) WithVLAN(vlanID uint16) *NetworkBuilder

WithVLAN sets vlan id in the SrIovNetwork definition. Allowed vlanId range is between 0-4094.

func (*NetworkBuilder) WithVlanProto

func (builder *NetworkBuilder) WithVlanProto(vlanProtocol string) *NetworkBuilder

WithVlanProto sets the VLAN protocol for qinq tunneling protocol in the SrIovNetwork definition spec.

func (*NetworkBuilder) WithVlanQoS

func (builder *NetworkBuilder) WithVlanQoS(qoSClass uint16) *NetworkBuilder

WithVlanQoS sets qoSClass parameters in the SrIovNetwork definition spec.

type NetworkNodeStateBuilder

type NetworkNodeStateBuilder struct {
	// Dynamically discovered SriovNetworkNodeState object.
	Objects *srIovV1.SriovNetworkNodeState
	// contains filtered or unexported fields
}

NetworkNodeStateBuilder provides struct for SriovNetworkNodeState object which contains connection to cluster and SriovNetworkNodeState definitions.

func ListNetworkNodeState

func ListNetworkNodeState(
	apiClient *clients.Settings, nsname string, options ...metav1.ListOptions) ([]*NetworkNodeStateBuilder, error)

ListNetworkNodeState returns SriovNetworkNodeStates inventory in the given namespace.

func NewNetworkNodeStateBuilder

func NewNetworkNodeStateBuilder(apiClient *clients.Settings, nodeName, nsname string) *NetworkNodeStateBuilder

NewNetworkNodeStateBuilder creates new instance of NetworkNodeStateBuilder.

func (*NetworkNodeStateBuilder) Discover

func (builder *NetworkNodeStateBuilder) Discover() error

Discover method gets the SriovNetworkNodeState items and stores them in the NetworkNodeStateBuilder struct.

func (*NetworkNodeStateBuilder) GetDriverName

func (builder *NetworkNodeStateBuilder) GetDriverName(sriovInterfaceName string) (string, error)

GetDriverName returns driver name under the given interface.

func (*NetworkNodeStateBuilder) GetNICs

func (builder *NetworkNodeStateBuilder) GetNICs() (srIovV1.InterfaceExts, error)

GetNICs returns a list of SrIov interfaces.

func (*NetworkNodeStateBuilder) GetNumVFs

func (builder *NetworkNodeStateBuilder) GetNumVFs(sriovInterfaceName string) (int, error)

GetNumVFs returns num-vfs under the given interface.

func (*NetworkNodeStateBuilder) GetPciAddress

func (builder *NetworkNodeStateBuilder) GetPciAddress(sriovInterfaceName string) (string, error)

GetPciAddress returns PciAddress under the given interface.

func (*NetworkNodeStateBuilder) GetUpNICs

func (builder *NetworkNodeStateBuilder) GetUpNICs() (srIovV1.InterfaceExts, error)

GetUpNICs returns a list of SrIov interfaces in UP state.

func (*NetworkNodeStateBuilder) WaitUntilSyncStatus

func (builder *NetworkNodeStateBuilder) WaitUntilSyncStatus(syncStatus string, timeout time.Duration) error

WaitUntilSyncStatus waits for the duration of the defined timeout or until the SriovNetworkNodeState gets to a specific syncStatus.

type OperatorConfigBuilder

type OperatorConfigBuilder struct {
	// SriovOperatorConfig definition, used to create the SriovOperatorConfig object.
	Definition *srIovV1.SriovOperatorConfig
	// Created SriovOperatorConfig object.
	Object *srIovV1.SriovOperatorConfig
	// contains filtered or unexported fields
}

OperatorConfigBuilder provides a struct for SriovOperatorConfig object from the cluster and a SriovOperatorConfig definition.

func NewOperatorConfigBuilder

func NewOperatorConfigBuilder(apiClient *clients.Settings, nsname string) *OperatorConfigBuilder

NewOperatorConfigBuilder creates new instance of OperatorConfigBuilder.

func PullOperatorConfig

func PullOperatorConfig(apiClient *clients.Settings, nsname string) (*OperatorConfigBuilder, error)

PullOperatorConfig loads an existing SriovOperatorConfig into OperatorConfigBuilder struct.

func (*OperatorConfigBuilder) Create

func (builder *OperatorConfigBuilder) Create() (*OperatorConfigBuilder, error)

Create generates SriovOperatorConfig in a cluster and stores the created object in struct.

func (*OperatorConfigBuilder) Delete

func (builder *OperatorConfigBuilder) Delete() (*OperatorConfigBuilder, error)

Delete removes SriovOperatorConfig object from a cluster.

func (*OperatorConfigBuilder) Exists

func (builder *OperatorConfigBuilder) Exists() bool

Exists checks whether the given SriovOperatorConfig exists.

func (*OperatorConfigBuilder) Update

func (builder *OperatorConfigBuilder) Update() (*OperatorConfigBuilder, error)

Update renovates the existing SriovOperatorConfig object with the new definition in builder.

func (*OperatorConfigBuilder) WithInjector

func (builder *OperatorConfigBuilder) WithInjector(enable bool) *OperatorConfigBuilder

WithInjector configures enableInjector in the SriovOperatorConfig.

func (*OperatorConfigBuilder) WithOperatorWebhook

func (builder *OperatorConfigBuilder) WithOperatorWebhook(enable bool) *OperatorConfigBuilder

WithOperatorWebhook configures enableOperatorWebhook in the SriovOperatorConfig.

type PolicyAdditionalOptions

type PolicyAdditionalOptions func(builder *PolicyBuilder) (*PolicyBuilder, error)

PolicyAdditionalOptions additional options for SriovNetworkNodePolicy object.

type PolicyBuilder

type PolicyBuilder struct {
	// srIovPolicy definition. Used to create srIovPolicy object.
	Definition *srIovV1.SriovNetworkNodePolicy
	// Created srIovPolicy object.
	Object *srIovV1.SriovNetworkNodePolicy
	// contains filtered or unexported fields
}

PolicyBuilder provides struct for srIovPolicy object containing connection to the cluster and the srIovPolicy definitions.

func ListPolicy

func ListPolicy(apiClient *clients.Settings, nsname string, options ...metav1.ListOptions) ([]*PolicyBuilder, error)

ListPolicy returns SriovNetworkNodePolicies inventory in the given namespace.

func NewPolicyBuilder

func NewPolicyBuilder(
	apiClient *clients.Settings,
	name string,
	nsname string,
	resName string,
	vfsNumber int,
	nicNames []string,
	nodeSelector map[string]string) *PolicyBuilder

NewPolicyBuilder creates a new instance of PolicyBuilder.

func PullPolicy

func PullPolicy(apiClient *clients.Settings, name, nsname string) (*PolicyBuilder, error)

PullPolicy pulls existing sriovnetworknodepolicy from cluster.

func (*PolicyBuilder) Create

func (builder *PolicyBuilder) Create() (*PolicyBuilder, error)

Create generates an SriovNetworkNodePolicy in the cluster and stores the created object in struct.

func (*PolicyBuilder) Delete

func (builder *PolicyBuilder) Delete() error

Delete removes an SriovNetworkNodePolicy object.

func (*PolicyBuilder) Exists

func (builder *PolicyBuilder) Exists() bool

Exists checks whether the given SriovNetworkNodePolicy object exists in the cluster.

func (*PolicyBuilder) WithDevType

func (builder *PolicyBuilder) WithDevType(devType string) *PolicyBuilder

WithDevType sets device type in the SriovNetworkNodePolicy definition. Allowed devTypes are vfio-pci and netdevice.

func (*PolicyBuilder) WithExternallyManaged

func (builder *PolicyBuilder) WithExternallyManaged(externallyManaged bool) *PolicyBuilder

WithExternallyManaged sets ExternallyManaged option in SriovNetworkNodePolicy object.

func (*PolicyBuilder) WithMTU

func (builder *PolicyBuilder) WithMTU(mtu int) *PolicyBuilder

WithMTU sets required MTU in the given SriovNetworkNodePolicy.

func (*PolicyBuilder) WithOptions

func (builder *PolicyBuilder) WithOptions(options ...PolicyAdditionalOptions) *PolicyBuilder

WithOptions creates SriovNetworkNodePolicy with generic mutation options.

func (*PolicyBuilder) WithRDMA

func (builder *PolicyBuilder) WithRDMA(rdma bool) *PolicyBuilder

WithRDMA sets RDMA mode in SriovNetworkNodePolicy object.

func (*PolicyBuilder) WithVFRange

func (builder *PolicyBuilder) WithVFRange(firstVF, lastVF int) *PolicyBuilder

WithVFRange sets specific VF range for each configured PF.

func (*PolicyBuilder) WithVhostNet

func (builder *PolicyBuilder) WithVhostNet(vhost bool) *PolicyBuilder

WithVhostNet sets Vhost mode in in SriovNetworkNodePolicy object.

type PoolConfigBuilder

type PoolConfigBuilder struct {
	// SriovNetworkPoolConfig definition. Used to create SriovNetworkPoolConfig object.
	Definition *srIovV1.SriovNetworkPoolConfig
	// Created sriovNetworkPoolConfig object.
	Object *srIovV1.SriovNetworkPoolConfig
	// contains filtered or unexported fields
}

PoolConfigBuilder provides struct for SriovNetworkPoolConfig object containing connection to the cluster and the SriovNetworkPoolConfig definitions.

func ListPoolConfigs

func ListPoolConfigs(apiClient *clients.Settings, namespace string) ([]*PoolConfigBuilder, error)

ListPoolConfigs returns a sriovNetworkPoolConfig list in a given namespace.

func NewPoolConfigBuilder

func NewPoolConfigBuilder(apiClient *clients.Settings, name, nsname string) *PoolConfigBuilder

NewPoolConfigBuilder creates a new instance of PoolConfigBuilder.

func PullPoolConfig

func PullPoolConfig(apiClient *clients.Settings, name, nsname string) (*PoolConfigBuilder, error)

PullPoolConfig pulls existing SriovNetworkPoolConfig from cluster.

func (*PoolConfigBuilder) Create

func (builder *PoolConfigBuilder) Create() (*PoolConfigBuilder, error)

Create generates an SriovNetworkPoolConfig in the cluster and stores the created object in struct.

func (*PoolConfigBuilder) Delete

func (builder *PoolConfigBuilder) Delete() error

Delete removes an SriovNetworkPoolConfig object.

func (*PoolConfigBuilder) Exists

func (builder *PoolConfigBuilder) Exists() bool

Exists checks whether the given SriovNetworkPoolConfig object exists in the cluster.

func (*PoolConfigBuilder) Get

Get returns SriovNetworkPoolConfig object if found.

func (*PoolConfigBuilder) Update

func (builder *PoolConfigBuilder) Update() (*PoolConfigBuilder, error)

Update renovates the existing SriovNetworkPoolConfig object with the new definition in builder.

func (*PoolConfigBuilder) WithMaxUnavailable

func (builder *PoolConfigBuilder) WithMaxUnavailable(maxUnavailable intstrutil.IntOrString) *PoolConfigBuilder

WithMaxUnavailable sets MaxUnavailable in the SriovNetworkPoolConfig definition.

func (*PoolConfigBuilder) WithNodeSelector

func (builder *PoolConfigBuilder) WithNodeSelector(nodeSelector map[string]string) *PoolConfigBuilder

WithNodeSelector sets nodeSelector in the SriovNetworkPoolConfig definition.

Jump to

Keyboard shortcuts

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