driver

package
v0.0.0-...-2f49bc2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 43 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSDriver

type AWSDriver struct {
	AWSMachineClass *v1alpha1.AWSMachineClass
	CloudConfig     *corev1.Secret
	UserData        string
	MachineID       string
	MachineName     string
}

AWSDriver is the driver struct for holding AWS machine information

func (*AWSDriver) Create

func (d *AWSDriver) Create() (string, string, error)

Create method is used to create a AWS machine

func (*AWSDriver) Delete

func (d *AWSDriver) Delete() error

Delete method is used to delete a AWS machine

func (*AWSDriver) GetExisting

func (d *AWSDriver) GetExisting() (string, error)

GetExisting method is used to get machineID for existing AWS machine

func (*AWSDriver) GetVMs

func (d *AWSDriver) GetVMs(machineID string) (VMs, error)

GetVMs returns a VM matching the machineID If machineID is an empty string then it returns all matching instances

type AlicloudDriver

type AlicloudDriver struct {
	AlicloudMachineClass *v1alpha1.AlicloudMachineClass
	CloudConfig          *corev1.Secret
	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() 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) 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

type AzureDriver

type AzureDriver struct {
	AzureMachineClass *v1alpha1.AzureMachineClass
	CloudConfig       *corev1.Secret
	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() 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) GetVMs

func (d *AzureDriver) GetVMs(machineID string) (VMs, 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.

type Driver

type Driver interface {
	Create() (string, string, error)
	Delete() error
	GetExisting() (string, error)
	GetVMs(string) (VMs, error)
}

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, secretRef *corev1.Secret, classKind string, machineClass interface{}, machineName string) Driver

NewDriver creates a new driver object based on the classKind

func NewFakeDriver

func NewFakeDriver(create func() (string, string, error), delete func() error, existing func() (string, error)) Driver

NewFakeDriver returns a new fakedriver object

func NewPacketDriver

func NewPacketDriver(create func() (string, error), delete func() error, existing func() (string, error)) Driver

NewPacketDriver returns an empty PacketDriver object

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() error

Delete deletes a fake driver

func (*FakeDriver) GetExisting

func (d *FakeDriver) GetExisting() (string, error)

GetExisting returns the existing fake driver

func (*FakeDriver) GetVMs

func (d *FakeDriver) GetVMs(name string) (VMs, error)

GetVMs returns a list of VMs

type GCPDriver

type GCPDriver struct {
	GCPMachineClass *v1alpha1.GCPMachineClass
	CloudConfig     *corev1.Secret
	UserData        string
	MachineID       string
	MachineName     string
}

GCPDriver is the driver struct for holding GCP machine information

func (*GCPDriver) Create

func (d *GCPDriver) Create() (string, string, error)

Create method is used to create a GCP machine

func (*GCPDriver) Delete

func (d *GCPDriver) Delete() error

Delete method is used to delete a GCP machine

func (*GCPDriver) GetExisting

func (d *GCPDriver) GetExisting() (string, error)

GetExisting method is used to get machineID for existing GCP machine

func (*GCPDriver) GetVMs

func (d *GCPDriver) GetVMs(machineID string) (VMs, error)

GetVMs returns a list of VMs

type OpenStackDriver

type OpenStackDriver struct {
	OpenStackMachineClass *v1alpha1.OpenStackMachineClass
	CloudConfig           *corev1.Secret
	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() 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) 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

type PacketDriver

type PacketDriver struct {
	PacketMachineClass *v1alpha1.PacketMachineClass
	CloudConfig        *corev1.Secret
	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() 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) 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

type VMs

type VMs map[string]string

VMs maintains a list of VM returned by the provider Key refers to the machine-id on the cloud provider value refers to the machine-name of the machine object

Jump to

Keyboard shortcuts

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