Documentation ¶
Overview ¶
Package driver contains the cloud provider specific implementations to manage machines
Package driver contains the cloud provider specific implementations to manage machines ¶
Package driver contains the cloud provider specific implementations to manage machines ¶
Package driver contains the cloud provider specific implementations to manage machines ¶
Package driver contains the cloud provider specific implementations to manage machines ¶
Package driver contains the cloud provider specific implementations to manage machines ¶
Package driver contains the cloud provider specific implementations to manage machines ¶
Package driver contains the cloud provider specific implementations to manage machines
Index ¶
- func ExtractCredentialsFromData(data map[string][]byte, keys ...string) string
- type AWSDriver
- func (d *AWSDriver) Create() (string, string, error)
- func (d *AWSDriver) Delete(machineID string) error
- func (d *AWSDriver) GetExisting() (string, error)
- func (d *AWSDriver) GetUserData() string
- func (d *AWSDriver) GetVMs(machineID string) (VMs, error)
- func (d *AWSDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
- func (d *AWSDriver) SetUserData(userData string)
- type AlicloudDriver
- func (c *AlicloudDriver) Create() (string, string, error)
- func (c *AlicloudDriver) Delete(machineID string) error
- func (c *AlicloudDriver) GetExisting() (string, error)
- func (c *AlicloudDriver) GetUserData() string
- func (c *AlicloudDriver) GetVMs(machineID string) (VMs, error)
- func (c *AlicloudDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
- func (c *AlicloudDriver) SetUserData(userData string)
- type AzureDriver
- func (d *AzureDriver) Create() (string, string, error)
- func (d *AzureDriver) Delete(machineID string) error
- func (d *AzureDriver) GetExisting() (string, error)
- func (d *AzureDriver) GetUserData() string
- func (d *AzureDriver) GetVMs(machineID string) (result VMs, err error)
- func (d *AzureDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
- func (d *AzureDriver) SetUserData(userData string)
- type Driver
- func NewAWSDriver(create func() (string, error), delete func() error, ...) Driver
- func NewDriver(machineID string, secretData map[string][]byte, classKind string, ...) Driver
- func NewFakeDriver(create func() (string, string, error), delete func(string) error, ...) Driver
- func NewPacketDriver(create func() (string, error), delete func() error, ...) Driver
- type FakeDriver
- func (d *FakeDriver) Create() (string, string, error)
- func (d *FakeDriver) Delete(machineID string) error
- func (d *FakeDriver) GetExisting() (string, error)
- func (d *FakeDriver) GetUserData() string
- func (d *FakeDriver) GetVMs(name string) (VMs, error)
- func (d *FakeDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
- func (d *FakeDriver) SetUserData(userData string)
- type GCPDriver
- func (d *GCPDriver) Create() (string, string, error)
- func (d *GCPDriver) Delete(machineID string) error
- func (d *GCPDriver) GetExisting() (string, error)
- func (d *GCPDriver) GetUserData() string
- func (d *GCPDriver) GetVMs(machineID string) (VMs, error)
- func (d *GCPDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
- func (d *GCPDriver) SetUserData(userData string)
- type OpenStackDriver
- func (d *OpenStackDriver) Create() (string, string, error)
- func (d *OpenStackDriver) Delete(machineID string) error
- func (d *OpenStackDriver) GetExisting() (string, error)
- func (d *OpenStackDriver) GetUserData() string
- func (d *OpenStackDriver) GetVMs(machineID string) (VMs, error)
- func (d *OpenStackDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
- func (d *OpenStackDriver) SetUserData(userData string)
- type PacketDriver
- func (d *PacketDriver) Create() (string, string, error)
- func (d *PacketDriver) Delete(machineID string) error
- func (d *PacketDriver) GetExisting() (string, error)
- func (d *PacketDriver) GetUserData() string
- func (d *PacketDriver) GetVMs(machineID string) (VMs, error)
- func (d *PacketDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
- func (d *PacketDriver) SetUserData(userData string)
- type VMs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractCredentialsFromData ¶
ExtractCredentialsFromData extracts and trims a value from the given data map. The first key that exists is being returned, otherwise, the next key is tried, etc. If no key exists then an empty string is returned.
Types ¶
type AWSDriver ¶
type AWSDriver struct { AWSMachineClass *v1alpha1.AWSMachineClass CredentialsData map[string][]byte UserData string MachineID string MachineName string }
AWSDriver is the driver struct for holding AWS machine information
func (*AWSDriver) GetExisting ¶
GetExisting method is used to get machineID for existing AWS machine
func (*AWSDriver) GetUserData ¶
GetUserData return the used data whit which the VM will be booted
func (*AWSDriver) GetVMs ¶
GetVMs returns a VM matching the machineID If machineID is an empty string then it returns all matching instances
func (*AWSDriver) GetVolNames ¶
func (d *AWSDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
GetVolNames parses volume names from pv specs
func (*AWSDriver) SetUserData ¶
SetUserData set the used data whit which the VM will be booted
type AlicloudDriver ¶
type AlicloudDriver struct { AlicloudMachineClass *v1alpha1.AlicloudMachineClass CredentialsData map[string][]byte UserData string MachineID string MachineName string }
AlicloudDriver is the driver struct for holding Alicloud machine information
func (*AlicloudDriver) Create ¶
func (c *AlicloudDriver) Create() (string, string, error)
Create is used to create a VM
func (*AlicloudDriver) Delete ¶
func (c *AlicloudDriver) Delete(machineID string) error
Delete method is used to delete an alicloud machine
func (*AlicloudDriver) GetExisting ¶
func (c *AlicloudDriver) GetExisting() (string, error)
GetExisting method is used to get machineID for existing Alicloud machine
func (*AlicloudDriver) GetUserData ¶
func (c *AlicloudDriver) GetUserData() string
GetUserData return the used data whit which the VM will be booted
func (*AlicloudDriver) GetVMs ¶
func (c *AlicloudDriver) GetVMs(machineID string) (VMs, error)
GetVMs returns a VM matching the machineID If machineID is an empty string then it returns all matching instances
func (*AlicloudDriver) GetVolNames ¶
func (c *AlicloudDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
GetVolNames parses volume names from pv specs
func (*AlicloudDriver) SetUserData ¶
func (c *AlicloudDriver) SetUserData(userData string)
SetUserData set the used data whit which the VM will be booted
type AzureDriver ¶
type AzureDriver struct { AzureMachineClass *v1alpha1.AzureMachineClass CredentialsData map[string][]byte UserData string MachineID string MachineName string }
AzureDriver is the driver struct for holding azure machine information
func (*AzureDriver) Create ¶
func (d *AzureDriver) Create() (string, string, error)
Create method is used to create an azure machine
func (*AzureDriver) Delete ¶
func (d *AzureDriver) Delete(machineID string) error
Delete method is used to delete an azure machine
func (*AzureDriver) GetExisting ¶
func (d *AzureDriver) GetExisting() (string, error)
GetExisting method is used to fetch the machineID for an azure machine
func (*AzureDriver) GetUserData ¶
func (d *AzureDriver) GetUserData() string
GetUserData return the user data with which the VM will be booted
func (*AzureDriver) GetVMs ¶
func (d *AzureDriver) GetVMs(machineID string) (result VMs, err error)
GetVMs returns a list of VM or VM resources Azure earlier treated all VM resources (instance, NIC, Disks) as a single resource and atomically created/deleted them in the driver interface. This caused issues when the controller crashes, during deletions. To fix this, now GetVMs interface checks for all resources instead of just VMs.
func (*AzureDriver) GetVolNames ¶
func (d *AzureDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
GetVolNames parses volume names from pv specs
func (*AzureDriver) SetUserData ¶
func (d *AzureDriver) SetUserData(userData string)
SetUserData set the used data whit which the VM will be booted
type Driver ¶
type Driver interface { Create() (string, string, error) Delete(string) error GetExisting() (string, error) GetVMs(string) (VMs, error) GetVolNames([]corev1.PersistentVolumeSpec) ([]string, error) GetUserData() string SetUserData(string) }
Driver is the common interface for creation/deletion of the VMs over different cloud-providers.
func NewAWSDriver ¶
func NewAWSDriver(create func() (string, error), delete func() error, existing func() (string, error)) Driver
NewAWSDriver returns an empty AWSDriver object
func NewDriver ¶
func NewDriver(machineID string, secretData map[string][]byte, classKind string, machineClass interface{}, machineName string) Driver
NewDriver creates a new driver object based on the classKind
type FakeDriver ¶
type FakeDriver struct {
// contains filtered or unexported fields
}
FakeDriver is a fake driver returned when none of the actual drivers match
func (*FakeDriver) Create ¶
func (d *FakeDriver) Create() (string, string, error)
Create returns a newly created fake driver
func (*FakeDriver) Delete ¶
func (d *FakeDriver) Delete(machineID string) error
Delete deletes a fake driver
func (*FakeDriver) GetExisting ¶
func (d *FakeDriver) GetExisting() (string, error)
GetExisting returns the existing fake driver
func (*FakeDriver) GetUserData ¶
func (d *FakeDriver) GetUserData() string
GetUserData return the used data whit which the VM will be booted
func (*FakeDriver) GetVMs ¶
func (d *FakeDriver) GetVMs(name string) (VMs, error)
GetVMs returns a list of VMs
func (*FakeDriver) GetVolNames ¶
func (d *FakeDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
GetVolNames parses volume names from pv specs
func (*FakeDriver) SetUserData ¶
func (d *FakeDriver) SetUserData(userData string)
SetUserData set the used data whit which the VM will be booted
type GCPDriver ¶
type GCPDriver struct { GCPMachineClass *v1alpha1.GCPMachineClass CredentialsData map[string][]byte UserData string MachineID string MachineName string }
GCPDriver is the driver struct for holding GCP machine information
func (*GCPDriver) GetExisting ¶
GetExisting method is used to get machineID for existing GCP machine
func (*GCPDriver) GetUserData ¶
GetUserData return the used data whit which the VM will be booted
func (*GCPDriver) GetVolNames ¶
func (d *GCPDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
GetVolNames parses volume names from pv specs
func (*GCPDriver) SetUserData ¶
SetUserData set the used data whit which the VM will be booted
type OpenStackDriver ¶
type OpenStackDriver struct { OpenStackMachineClass *v1alpha1.OpenStackMachineClass CredentialsData map[string][]byte UserData string MachineID string MachineName string }
OpenStackDriver is the driver struct for holding OS machine information
func (*OpenStackDriver) Create ¶
func (d *OpenStackDriver) Create() (string, string, error)
Create method is used to create an OS machine
func (*OpenStackDriver) Delete ¶
func (d *OpenStackDriver) Delete(machineID string) error
Delete method is used to delete an OS machine
func (*OpenStackDriver) GetExisting ¶
func (d *OpenStackDriver) GetExisting() (string, error)
GetExisting method is used to get machineID for existing OS machine
func (*OpenStackDriver) GetUserData ¶
func (d *OpenStackDriver) GetUserData() string
GetUserData return the used data whit which the VM will be booted
func (*OpenStackDriver) GetVMs ¶
func (d *OpenStackDriver) GetVMs(machineID string) (VMs, error)
GetVMs returns a VM matching the machineID If machineID is an empty string then it returns all matching instances
func (*OpenStackDriver) GetVolNames ¶
func (d *OpenStackDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
GetVolNames parses volume names from pv specs
func (*OpenStackDriver) SetUserData ¶
func (d *OpenStackDriver) SetUserData(userData string)
SetUserData set the used data whit which the VM will be booted
type PacketDriver ¶
type PacketDriver struct { PacketMachineClass *v1alpha1.PacketMachineClass CredentialsData map[string][]byte UserData string MachineID string MachineName string }
PacketDriver is the driver struct for holding Packet machine information
func (*PacketDriver) Create ¶
func (d *PacketDriver) Create() (string, string, error)
Create method is used to create a Packet machine
func (*PacketDriver) Delete ¶
func (d *PacketDriver) Delete(machineID string) error
Delete method is used to delete a Packet machine
func (*PacketDriver) GetExisting ¶
func (d *PacketDriver) GetExisting() (string, error)
GetExisting method is used to get machineID for existing Packet machine
func (*PacketDriver) GetUserData ¶
func (d *PacketDriver) GetUserData() string
GetUserData return the used data whit which the VM will be booted
func (*PacketDriver) GetVMs ¶
func (d *PacketDriver) GetVMs(machineID string) (VMs, error)
GetVMs returns a machine matching the machineID If machineID is an empty string then it returns all matching instances
func (*PacketDriver) GetVolNames ¶
func (d *PacketDriver) GetVolNames(specs []corev1.PersistentVolumeSpec) ([]string, error)
GetVolNames parses volume names from pv specs
func (*PacketDriver) SetUserData ¶
func (d *PacketDriver) SetUserData(userData string)
SetUserData set the used data whit which the VM will be booted