libvmi

package
v0.35.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultResourceMemory        = "8192Ki"
	DefaultTestGracePeriod int64 = 0
	DefaultVmiName               = "testvmi"
)

Default VMI values

Variables

This section is empty.

Functions

func InterfaceDeviceWithBridgeBinding added in v0.34.0

func InterfaceDeviceWithBridgeBinding() kvirtv1.Interface

InterfaceDeviceWithBridgeBinding returns an Interface named "default" with bridge binding.

func InterfaceDeviceWithMasqueradeBinding

func InterfaceDeviceWithMasqueradeBinding(ports ...kvirtv1.Port) kvirtv1.Interface

InterfaceDeviceWithMasqueradeBinding returns an Interface named "default" with masquerade binding.

func MultusNetwork added in v0.35.0

func MultusNetwork(networkName string) kvirtv1.Network

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 RandName

func RandName(name string) string

RandName returns a random name by concatanating the given name with a random string.

Types

type Option

type Option func(vmi *kvirtv1.VirtualMachineInstance)

Option represents an action that enables an option.

func WithCloudInitNoCloudNetworkData added in v0.35.0

func WithCloudInitNoCloudNetworkData(data string, b64Encoding bool) Option

WithCloudInitNoCloudNetworkData adds cloud-init no-cloud network data.

func WithCloudInitNoCloudUserData

func WithCloudInitNoCloudUserData(data string, b64Encoding bool) Option

WithCloudInitNoCloudUserData adds cloud-init no-cloud user data.

func WithContainerImage

func WithContainerImage(name string) Option

WithContainerImage specifies the name of the container image to be used.

func WithInterface

func WithInterface(iface kvirtv1.Interface) Option

WithInterface adds a Domain Device Interface.

func WithNetwork

func WithNetwork(network *kvirtv1.Network) Option

WithNetwork adds a network object.

func WithResourceMemory

func WithResourceMemory(value string) Option

WithResourceMemory specifies the vmi memory resource.

func WithRng

func WithRng() Option

WithRng adds `rng` to the the vmi devices.

func WithTerminationGracePeriod

func WithTerminationGracePeriod(seconds int64) Option

WithTerminationGracePeriod specifies the termination grace period in seconds.

Jump to

Keyboard shortcuts

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