vm

package
v0.0.0-...-85c0cb9 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(verb string, args ...string) (string, error)

Run the docker-machine comand

Types

type Cluster

type Cluster struct {
	CloudProvider string     `yaml:"cloudProvider"`
	Manager       ClusterSet `yaml:"manager"`
	Worker        ClusterSet `yaml:"worker"`
	// contains filtered or unexported fields
}

Cluster describes the build-out info for 2 cluster sets:

manager, worker

func GetDefaultCluster

func GetDefaultCluster(runnerOpt ...Runner) *Cluster

GetDefaultCluster returns a simple default cluster config

func LoadClusterConfig

func LoadClusterConfig(clusterConfigFile string, runnerOpt ...Runner) (*Cluster, error)

LoadClusterConfig deserializes a yaml file with the cluster configuration

func (*Cluster) CreateVMs

func (c *Cluster) CreateVMs(cloudAPIToken string) error

CreateVMs creates a cluster of VMs on the cloud provider

func (*Cluster) GetMachines

func (c *Cluster) GetMachines() []*Machine

GetMachines returns list of machines and their configuration

type ClusterSet

type ClusterSet struct {
	Basename      string `yaml:"basename"`
	NodeCount     int    `yaml:"nodeCount"`
	VMOptionsFile string `yaml:"vmOptionsFile,omitempty"`
	// contains filtered or unexported fields
}

ClusterSet describes the build-out info for a set of cluster machines

type Config

type Config struct {
	VMName        string
	CloudProvider string
	CloudAPIToken string
	// contains filtered or unexported fields
}

Config represents the CoreOS VM configuration

func NewConfig

func NewConfig(vmName string, cloudProvider string, optionsYamlFile string) (*Config, error)

NewConfig parses the options file and returns a new VM configuration

func NewConfigFrom

func NewConfigFrom(vmName string, cloudProvider string, providerConfig ConfigRenderer) (*Config, error)

NewConfigFrom returns a new VM configuration from an already existing providerConfig

func (Config) GetCreateArguments

func (c Config) GetCreateArguments() ([]string, error)

GetCreateArguments builds and returns a list of cmd line arguments to pass to docker-machine's create command

type ConfigRenderer

type ConfigRenderer interface {
	Render(apiToken string) ([]string, error)
}

ConfigRenderer is the contract to render a configuration's argument string array

func GetDefaultProviderConfig

func GetDefaultProviderConfig(cloudProvider string) (ConfigRenderer, error)

GetDefaultProviderConfig returns the default config renderer

func LoadProviderConfig

func LoadProviderConfig(cloudProvider string, optionsYamlFile string) (ConfigRenderer, error)

LoadProviderConfig parses and returns a cloud provider config renderer

type Machine

type Machine struct {
	// contains filtered or unexported fields
}

Machine represents a VM as known to local docker-machine

func NewMachine

func NewMachine(config *Config, runnerOpt ...Runner) *Machine

NewMachine instance of Machine

func (*Machine) CreateMachine

func (m *Machine) CreateMachine() error

CreateMachine initiates the creation of a new VM

func (*Machine) Exists

func (m *Machine) Exists() (bool, error)

Exists checks if this machine is already known to local docker-machine

type ReleaseChannel

type ReleaseChannel int

ReleaseChannel enum represents a CoreOS release channel

const (
	Stable ReleaseChannel = iota
	Beta
	Alpha
)

Stable etc. release channels

func (ReleaseChannel) String

func (c ReleaseChannel) String() string

type Runner

type Runner interface {
	Run(exeName string, args ...string) (string, error)
}

Runner is an abstraction of os/exec's Cmd, Run & Output func; also useful for mocking

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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