Documentation ¶
Index ¶
Constants ¶
const (
BuilderId = "joyent.triton"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessConfig ¶
type AccessConfig struct { Endpoint string `mapstructure:"sdc_url"` Account string `mapstructure:"sdc_account"` KeyID string `mapstructure:"sdc_key_id"` KeyPath string `mapstructure:"sdc_key_path"` }
AccessConfig is for common configuration related to Triton access
func (*AccessConfig) Comm ¶
func (c *AccessConfig) Comm() communicator.Config
func (*AccessConfig) CreateSDCClient ¶
func (c *AccessConfig) CreateSDCClient() (*cloudapi.Client, error)
CreateSDCClient returns an SDC client configured with the appropriate client credentials or an error if creating the client fails.
func (*AccessConfig) Prepare ¶
func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
Prepare performs basic validation on the AccessConfig
type Artifact ¶
type Artifact struct { // ImageID is the image ID of the artifact ImageID string // BuilderIDValue is the unique ID for the builder that created this Image BuilderIDValue string // SDC connection for cleanup etc SDCClient *cloudapi.Client }
Artifact is an artifact implementation that contains built Triton images.
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { common.PackerConfig `mapstructure:",squash"` AccessConfig `mapstructure:",squash"` SourceMachineConfig `mapstructure:",squash"` TargetImageConfig `mapstructure:",squash"` Comm communicator.Config `mapstructure:",squash"` // contains filtered or unexported fields }
type SourceMachineConfig ¶
type SourceMachineConfig struct { MachineName string `mapstructure:"source_machine_name"` MachinePackage string `mapstructure:"source_machine_package"` MachineImage string `mapstructure:"source_machine_image"` MachineNetworks []string `mapstructure:"source_machine_networks"` MachineMetadata map[string]string `mapstructure:"source_machine_metadata"` MachineTags map[string]string `mapstructure:"source_machine_tags"` MachineFirewallEnabled bool `mapstructure:"source_machine_firewall_enabled"` }
SourceMachineConfig represents the configuration to run a machine using the SDC API in order for provisioning to take place.
func (*SourceMachineConfig) Prepare ¶
func (c *SourceMachineConfig) Prepare(ctx *interpolate.Context) []error
Prepare performs basic validation on a SourceMachineConfig struct.
type StepCreateImageFromMachine ¶
type StepCreateImageFromMachine struct { ImageName string ImageVersion string ImageDescription string ImageHomepage string ImageEULA string ImageACL []string ImageTags map[string]string // contains filtered or unexported fields }
StepCreateImageFromMachine creates an image with the specified attributes from the machine with the given ID, and waits for the image to be created. The machine must be in the "stopped" state prior to this step being run.
func (*StepCreateImageFromMachine) Cleanup ¶
func (s *StepCreateImageFromMachine) Cleanup(state multistep.StateBag)
func (*StepCreateImageFromMachine) Run ¶
func (s *StepCreateImageFromMachine) Run(state multistep.StateBag) multistep.StepAction
type StepCreateSourceMachine ¶
type StepCreateSourceMachine struct { MachineName string MachinePackage string MachineImage string MachineNetworks []string MachineMetadata map[string]string MachineTags map[string]string MachineFirewallEnabled bool Comm communicator.Config `mapstructure:",squash"` // contains filtered or unexported fields }
StepCreateSourceMachine creates an machine with the specified attributes and waits for it to become available for provisioners.
func (*StepCreateSourceMachine) Cleanup ¶
func (s *StepCreateSourceMachine) Cleanup(state multistep.StateBag)
func (*StepCreateSourceMachine) Run ¶
func (s *StepCreateSourceMachine) Run(state multistep.StateBag) multistep.StepAction
type StepDeleteMachine ¶
type StepDeleteMachine struct{}
StepDeleteMachine deletes the machine with the ID specified in state["machine"]
func (*StepDeleteMachine) Cleanup ¶
func (s *StepDeleteMachine) Cleanup(state multistep.StateBag)
func (*StepDeleteMachine) Run ¶
func (s *StepDeleteMachine) Run(state multistep.StateBag) multistep.StepAction
type StepStopMachine ¶
type StepStopMachine struct{}
StepStopMachine stops the machine with the given Machine ID, and waits for it to reach the stopped state.
func (*StepStopMachine) Cleanup ¶
func (s *StepStopMachine) Cleanup(state multistep.StateBag)
func (*StepStopMachine) Run ¶
func (s *StepStopMachine) Run(state multistep.StateBag) multistep.StepAction
type StepWaitForStopNotToFail ¶
type StepWaitForStopNotToFail struct{}
StepWaitForStopNotToFail waits for 10 seconds before returning with continue in order to prevent an observed issue where machines stopped immediately after they are started never actually stop.
func (*StepWaitForStopNotToFail) Cleanup ¶
func (s *StepWaitForStopNotToFail) Cleanup(state multistep.StateBag)
func (*StepWaitForStopNotToFail) Run ¶
func (s *StepWaitForStopNotToFail) Run(state multistep.StateBag) multistep.StepAction
type TargetImageConfig ¶
type TargetImageConfig struct { ImageName string `mapstructure:"image_name"` ImageVersion string `mapstructure:"image_version"` ImageDescription string `mapstructure:"image_description"` ImageHomepage string `mapstructure:"image_homepage"` ImageEULA string `mapstructure:"image_eula_url"` ImageACL []string `mapstructure:"image_acls"` ImageTags map[string]string `mapstructure:"image_tags"` }
TargetImageConfig represents the configuration for the image to be created from the source machine.
func (*TargetImageConfig) Prepare ¶
func (c *TargetImageConfig) Prepare(ctx *interpolate.Context) []error
Prepare performs basic validation on a TargetImageConfig struct.