bootstrap

package
v0.0.0-...-c283e9f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: BSD-3-Clause Imports: 35 Imported by: 2

README

Bootstrap

Bootstrap performs a list of actions against a Flynn cluster. It is typically used to boot Flynn layer 1 services on a new layer 0 cluster.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, action Action)

func Run

func Run(manifestData []byte, ch chan<- *StepInfo, cfg Config, only []string) error

Types

type Action

type Action interface {
	Run(*State) error
}

type AddAppAction

type AddAppAction struct {
	ID string `json:"id"`

	FromStep string  `json:"from_step"`
	App      *ct.App `json:"app"`
}

func (*AddAppAction) Run

func (a *AddAppAction) Run(s *State) error

type AddProviderAction

type AddProviderAction struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

AddProvider registers a provider on the controller.

func (*AddProviderAction) Run

func (a *AddProviderAction) Run(s *State) error

type AddRouteAction

type AddRouteAction struct {
	ID string `json:"id"`

	AppStep  string `json:"app_step"`
	CertStep string `json:"cert_step"`
	*router.Route
}

func (*AddRouteAction) Run

func (a *AddRouteAction) Run(s *State) error

type AddRouteState

type AddRouteState struct {
	App   *ct.App       `json:"app"`
	Route *router.Route `json:"route"`
}

type AppState

type AppState struct {
	*ct.ExpandedFormation
	Formation *ct.Formation  `json:"formation"`
	Resources []*ct.Resource `json:"resources"`
}

type ClusterMonitorAction

type ClusterMonitorAction struct {
	Enabled bool `json:"enabled"`
}

func (*ClusterMonitorAction) Run

func (c *ClusterMonitorAction) Run(s *State) error

type Config

type Config struct {
	ClusterURL string
	IPs        []string
	MinHosts   int
	Timeout    int
	Singleton  bool
	JobTimeout int
}

type CreateArtifactAction

type CreateArtifactAction struct {
	ID string `json:"id"`

	Artifact *ct.Artifact `json:"artifact"`
}

func (*CreateArtifactAction) Run

func (a *CreateArtifactAction) Run(s *State) error

type DeployAppAction

type DeployAppAction struct {
	ID string `json:"id"`

	*ct.ExpandedFormation
	App       *ct.App        `json:"app"`
	Resources []*ct.Provider `json:"resources"`
}

func (*DeployAppAction) Run

func (a *DeployAppAction) Run(s *State) error

type GenRandomAction

type GenRandomAction struct {
	ID       string `json:"id"`
	Length   int    `json:"length"`
	Data     string `json:"data"`
	Encoding string `json:"encoding"`

	ControllerKey bool `json:"controller_key"`
}

func (*GenRandomAction) Run

func (a *GenRandomAction) Run(s *State) error

type GenTLSCertAction

type GenTLSCertAction struct {
	ID    string   `json:"id"`
	Hosts []string `json:"hosts"`

	CACert     string `json:"ca_cert"`
	Cert       string `json:"cert"`
	PrivateKey string `json:"key"`
}

func (*GenTLSCertAction) Run

func (a *GenTLSCertAction) Run(s *State) (err error)

type LogAction

type LogAction struct {
	ID     string `json:"id"`
	Output string `json:"output"`
}

func (*LogAction) Run

func (a *LogAction) Run(s *State) error

type LogMessage

type LogMessage struct {
	Msg string `json:"message"`
}

func (*LogMessage) String

func (l *LogMessage) String() string

type Manifest

type Manifest []Step

func UnmarshalManifest

func UnmarshalManifest(manifestData []byte, only []string) (Manifest, error)

func (Manifest) Run

func (m Manifest) Run(ch chan<- *StepInfo, cfg Config) (state *State, err error)

func (Manifest) RunWithState

func (m Manifest) RunWithState(ch chan<- *StepInfo, state *State) (*State, error)

type MonitorMetadata

type MonitorMetadata struct {
	Enabled bool `json:"enabled,omitempty"`
	Hosts   int  `json:"hosts,omitempty"`
}

type Provider

type Provider struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type RandomData

type RandomData struct {
	Data string `json:"data"`
}

func (*RandomData) String

func (d *RandomData) String() string

type RequireEnv

type RequireEnv struct {
	Vars []string `json:"vars"`
}

func (*RequireEnv) Run

func (a *RequireEnv) Run(s *State) error

type ResourceCheckAction

type ResourceCheckAction struct {
	Ports []host.Port
}

func (*ResourceCheckAction) Run

func (a *ResourceCheckAction) Run(s *State) error

type RunAppAction

type RunAppAction struct {
	*ct.ExpandedFormation

	ID        string         `json:"id"`
	AppStep   string         `json:"app_step"`
	Resources []*ct.Provider `json:"resources,omitempty"`
}

func (*RunAppAction) Run

func (a *RunAppAction) Run(s *State) error

type RunAppState

type RunAppState struct {
	*ct.ExpandedFormation
	Providers []*ct.Provider       `json:"providers"`
	Resources []*resource.Resource `json:"resources"`
}

type ScaleAppAction

type ScaleAppAction struct {
	AppStep string `json:"app_step"`

	*ct.Formation
}

func (*ScaleAppAction) Run

func (a *ScaleAppAction) Run(s *State) error

type SireniaWaitAction

type SireniaWaitAction struct {
	Service string `json:"service"`
}

func (*SireniaWaitAction) Run

func (a *SireniaWaitAction) Run(s *State) error

type State

type State struct {
	StepData    map[string]interface{}
	Providers   map[string]*ct.Provider
	Singleton   bool
	ClusterURL  string
	MinHosts    int
	Hosts       []*cluster.Host
	HostTimeout time.Duration
	JobTimeout  time.Duration
	// contains filtered or unexported fields
}

func (*State) ControllerClient

func (s *State) ControllerClient() (controller.Client, error)

func (*State) DiscoverdClient

func (s *State) DiscoverdClient() (*discoverd.Client, error)

func (*State) SetControllerKey

func (s *State) SetControllerKey(key string)

func (*State) ShuffledHosts

func (s *State) ShuffledHosts() []*cluster.Host

func (*State) SortedHostIPs

func (s *State) SortedHostIPs() []string

type StatusCheckAction

type StatusCheckAction struct {
	ID      string `json:"id"`
	URL     string `json:"url"`
	Output  string `json:"output"`
	Timeout int    `json:"timeout"` // in seconds
}

func (*StatusCheckAction) Run

func (a *StatusCheckAction) Run(s *State) error

type StatusData

type StatusData struct {
	Status string                  `json:"status"`
	Detail map[string]StatusDetail `json:"detail"`
}

type StatusDetail

type StatusDetail struct {
	Status string `json:"status"`
}

type StatusResponse

type StatusResponse struct {
	Data StatusData `json:"data"`
}

type Step

type Step struct {
	StepMeta
	Action
}

type StepInfo

type StepInfo struct {
	StepMeta
	StepData  interface{} `json:"data,omitempty"`
	State     string      `json:"state"`
	Error     string      `json:"error,omitempty"`
	Err       error       `json:"-"`
	Timestamp time.Time   `json:"ts"`
}

type StepMeta

type StepMeta struct {
	ID     string `json:"id"`
	Action string `json:"action"`
}

type WaitAction

type WaitAction struct {
	URL    string `json:"url"`
	Host   string `json:"host"`
	Status int    `json:"status"`
}

func (*WaitAction) Run

func (a *WaitAction) Run(s *State) error

type WaitHostsAction

type WaitHostsAction struct{}

func (*WaitHostsAction) Run

func (a *WaitHostsAction) Run(s *State) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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