executor

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const NoValidHost = "not enough hosts available"

NoValidHost is a part of the error message returned when there is no valid host in the zone to deploy a VM.

Variables

View Source
var (
	// ErrNotFound is returned when the requested resource could not be found.
	ErrNotFound = fmt.Errorf("resource not found")

	// ErrMultipleFound is returned when a resource that is expected to be unique has multiple matches.
	// For example, reverse lookups from names to IDs may yield multiple matches because names are not unique in most
	// OpenStack resources. In case this case, where a unique ID could not be determined an ErrMultipleFound is returned.
	ErrMultipleFound = fmt.Errorf("multiple resources found")
)

Functions

This section is empty.

Types

type Executor

type Executor struct {
	Compute client.Compute
	Network client.Network
	Storage client.Storage
	Config  *api.MachineProviderConfig
}

Executor concretely handles the execution of requests to the machine controller. Executor is responsible for communicating with OpenStack services and orchestrates the operations.

func NewExecutor

func NewExecutor(factory *client.Factory, config *api.MachineProviderConfig) (*Executor, error)

NewExecutor returns a new instance of Executor.

func (*Executor) CreateMachine

func (ex *Executor) CreateMachine(ctx context.Context, machineName string, userData []byte) (string, error)

CreateMachine creates a new OpenStack server instance and waits until it reports "ACTIVE". If there is an error during the build process, or if the building phase timeouts, it will delete any artifacts created.

func (*Executor) DeleteMachine

func (ex *Executor) DeleteMachine(ctx context.Context, machineName, providerID string) error

DeleteMachine deletes a server based on the supplied machineName. If a providerID is supplied it is used instead of the machineName to locate the server.

func (*Executor) ListMachines

func (ex *Executor) ListMachines(ctx context.Context) (map[string]string, error)

ListMachines lists returns a map from the server's encoded provider ID to the server name.

Jump to

Keyboard shortcuts

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