harvester

package
v0.1.2-test Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHostIsNotRunning = errors.New("Host is not running")

ErrHostIsNotRunning is an error that shows that the VM is not Running

Functions

func MustBeRunning

func MustBeRunning(d *Driver) error

MustBeRunning will return an error if the machine is not in a running state.

Types

type Driver

type Driver struct {
	*drivers.BaseDriver

	VMLabels      map[string]string
	VMName        string
	VMDescription string
	SSHKeyName    string
	VMImageID     string
	DiskSize      string
	MemSize       string
	NBCPUCores    uint32
	HarvesterHost string
	CACertBase64  string
	CertBase64    string
	KeyBase64     string
	Namespace     string
	DockerPort    int
	VM            *v1.VirtualMachine
}

Driver represents Harvester Docker Machine Driver.

func NewDriver

func NewDriver(hostName, storePath string) *Driver

NewDriver returns a new driver instance.

func (*Driver) Create

func (d *Driver) Create() error

Create will create the VM and return error if it fails

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver.

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags returns list of create flags driver accepts.

func (*Driver) GetHostIP

func (d *Driver) GetHostIP() (string, error)

GetHostIP gets the IP of the Host on which the machine is running

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

GetIP returns public IP address or hostname of the machine instance.

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

GetSSHHostname returns an IP address or hostname for the machine instance.

func (*Driver) GetSSHKeyPath

func (d *Driver) GetSSHKeyPath() string

GetSSHKeyPath return the SSH Key Path

func (*Driver) GetSSHPort

func (d *Driver) GetSSHPort() (int, error)

GetSSHPort returns an IP address or hostname for the machine instance.

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

GetSSHUsername returns an IP address or hostname for the machine instance.

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state of the virtual machine role instance.

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL returns a socket address to connect to Docker engine of the machine instance.

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops the virtual machine role instance.

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() (err error)

PreCreateCheck validates if driver values are valid to create the machine.

func (*Driver) Remove

func (d *Driver) Remove() error

Remove a VM from Harvester

func (*Driver) Restart

func (d *Driver) Restart() error

Restart reboots the virtual machine instance.

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(fl drivers.DriverOptions) error

SetConfigFromFlags initializes driver values from the command line values and checks if the arguments have values.

func (*Driver) Start

func (d *Driver) Start() error

Start issues a power on for the virtual machine instance.

func (*Driver) Stop

func (d *Driver) Stop() error

Stop issues a power off for the virtual machine instance.

Jump to

Keyboard shortcuts

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