Documentation
¶
Index ¶
- Constants
- func GetPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
- func IndexInterfaceStatusByName(vmi *v1.VirtualMachineInstance) map[string]v1.VirtualMachineInstanceNetworkInterface
- func InterfaceDeviceWithBridgeBinding() kvirtv1.Interface
- func InterfaceDeviceWithMasqueradeBinding(ports ...kvirtv1.Port) kvirtv1.Interface
- func InterfaceDeviceWithSRIOVBinding(name string) kvirtv1.Interface
- func InterfaceWithMac(iface *kvirtv1.Interface, macAddress string) *kvirtv1.Interface
- func MultusNetwork(networkName string) *kvirtv1.Network
- func New(name string, opts ...Option) *kvirtv1.VirtualMachineInstance
- func NewCirros(opts ...Option) *kvirtv1.VirtualMachineInstance
- func NewFedora(opts ...Option) *kvirtv1.VirtualMachineInstance
- func NewSriovFedora(opts ...Option) *kvirtv1.VirtualMachineInstance
- func NewTestToolingFedora(opts ...Option) *kvirtv1.VirtualMachineInstance
- func RandName(name string) string
- type Option
- func WithAnnotation(key, value string) Option
- func WithCloudInitNoCloudNetworkData(data string, b64Encoding bool) Option
- func WithCloudInitNoCloudUserData(data string, b64Encoding bool) Option
- func WithContainerImage(name string) Option
- func WithInterface(iface kvirtv1.Interface) Option
- func WithLabel(key, value string) Option
- func WithNetwork(network *kvirtv1.Network) Option
- func WithResourceMemory(value string) Option
- func WithRng() Option
- func WithTerminationGracePeriod(seconds int64) Option
Constants ¶
const ( DefaultTestGracePeriod int64 = 0 DefaultVmiName = "testvmi" )
Default VMI values
Variables ¶
This section is empty.
Functions ¶
func GetPodByVirtualMachineInstance ¶ added in v0.36.0
func GetPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
func IndexInterfaceStatusByName ¶ added in v0.36.0
func IndexInterfaceStatusByName(vmi *v1.VirtualMachineInstance) map[string]v1.VirtualMachineInstanceNetworkInterface
func InterfaceDeviceWithBridgeBinding ¶ added in v0.34.0
InterfaceDeviceWithBridgeBinding returns an Interface named "default" with bridge binding.
func InterfaceDeviceWithMasqueradeBinding ¶
InterfaceDeviceWithMasqueradeBinding returns an Interface named "default" with masquerade binding.
func InterfaceDeviceWithSRIOVBinding ¶ added in v0.36.0
InterfaceDeviceWithSRIOVBinding returns an Interface with SRIOV binding.
func InterfaceWithMac ¶ added in v0.36.0
InterfaceWithMac decorates an existing Interface with a MAC address.
func MultusNetwork ¶ added in v0.35.0
MultusNetwork returns a Network with the given name
func New ¶
func New(name string, opts ...Option) *kvirtv1.VirtualMachineInstance
New instantiates a new VMI configuration, building its properties based on the specified With* options.
func NewCirros ¶ added in v0.34.0
func NewCirros(opts ...Option) *kvirtv1.VirtualMachineInstance
NewCirros instantiates a new CirrOS based VMI configuration
func NewFedora ¶
func NewFedora(opts ...Option) *kvirtv1.VirtualMachineInstance
NewFedora instantiates a new Fedora based VMI configuration, building its extra properties based on the specified With* options.
func NewSriovFedora ¶ added in v0.36.0
func NewSriovFedora(opts ...Option) *kvirtv1.VirtualMachineInstance
NewSriovFedora instantiates a new Fedora based VMI configuration, building its extra properties based on the specified With* options, the image used include Guest Agent and some moduled needed by SRIOV.
func NewTestToolingFedora ¶ added in v0.39.0
func NewTestToolingFedora(opts ...Option) *kvirtv1.VirtualMachineInstance
NewTestToolingFedora instantiates a new Fedora based VMI configuration, building its extra properties based on the specified With* options. This image has tooling for the guest agent, stress, and more
Types ¶
type Option ¶
type Option func(vmi *kvirtv1.VirtualMachineInstance)
Option represents an action that enables an option.
func WithAnnotation ¶ added in v0.42.0
WithAnnotation adds an annotation with specified value
func WithCloudInitNoCloudNetworkData ¶ added in v0.35.0
WithCloudInitNoCloudNetworkData adds cloud-init no-cloud network data.
func WithCloudInitNoCloudUserData ¶
WithCloudInitNoCloudUserData adds cloud-init no-cloud user data.
func WithContainerImage ¶
WithContainerImage specifies the name of the container image to be used.
func WithInterface ¶
WithInterface adds a Domain Device Interface.
func WithNetwork ¶
WithNetwork adds a network object.
func WithResourceMemory ¶
WithResourceMemory specifies the vmi memory resource.
func WithTerminationGracePeriod ¶
WithTerminationGracePeriod specifies the termination grace period in seconds.