Documentation ¶
Index ¶
- Variables
- func CreateDomain(name, ignKey, volumeName, hostName, networkInterfaceName, ... string, ...) error
- func CreateIgntion(pool, name, content string, client *Client) error
- func CreateNetwork(name, domain, bridge, mode string, addresses []string, autostart bool, ...) error
- func CreateVolume(volumeName, poolName, baseVolumeID, source, volumeFormat string, ...) error
- func DeleteDomain(name string, client *Client) error
- func DeleteNetwork(name string, client *Client) error
- func DeleteVolume(name string, client *Client) error
- func DomainExists(name string, client *Client) (bool, error)
- func DomainStateString(state libvirt.DomainState) string
- func HasDHCP(net libvirtxml.Network) bool
- func LookupDomainByName(name string, client *Client) (*libvirt.Domain, error)
- func NodeAddresses(dom *libvirt.Domain) ([]corev1.NodeAddress, error)
- type Client
- type Config
- type Network
- type StreamIO
Constants ¶
This section is empty.
Variables ¶
var ErrLibVirtConIsNil = errors.New("the libvirt connection was nil")
ErrLibVirtConIsNil is returned when the libvirt connection is nil.
var WaitSleepInterval = 1 * time.Second
WaitSleepInterval time
var WaitTimeout = 5 * time.Minute
WaitTimeout time
Functions ¶
func CreateDomain ¶
func CreateDomain(name, ignKey, volumeName, hostName, networkInterfaceName, networkInterfaceAddress string, autostart bool, memory, vcpu, offset int, client *Client, cloudInit *providerconfigv1.CloudInit, kubeClient kubernetes.Interface, machineNamespace string) error
func CreateIgntion ¶
func CreateNetwork ¶
func CreateVolume ¶
func DeleteDomain ¶
func DeleteNetwork ¶
func DeleteVolume ¶
DeleteVolume removes the volume identified by `key` from libvirt
func DomainExists ¶
DomainExists verify a domain exists for given machine
func DomainStateString ¶
func DomainStateString(state libvirt.DomainState) string
DomainStateString returns a human-readable string for the given libvirt domain state.
func HasDHCP ¶
func HasDHCP(net libvirtxml.Network) bool
HasDHCP checks if the network has a DHCP server managed by libvirt
func LookupDomainByName ¶
LookupDomainByName looks up a domain by name and returns a pointer to it. Note: The caller is responsible for freeing the returned domain.
func NodeAddresses ¶
func NodeAddresses(dom *libvirt.Domain) ([]corev1.NodeAddress, error)
NodeAddresses returns a slice of corev1.NodeAddress objects for a given libvirt domain.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client libvirt
func BuildClient ¶
Client libvirt, generate libvirt client given URI
type Network ¶
type Network interface {
GetXMLDesc(flags libvirt.NetworkXMLFlags) (string, error)
}
Network interface used to expose a libvirt.Network