install

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureApp

func EnsureApp(req appservice.AppPullRequest) (*app.Application, error)

EnsureApp makes sure that the installer has the application being installed available locally

If there's no installer tarball (and hence, no application), then it replicates the metadata of the application and its dependencies from remote Ops Center (for which remote Ops Center credentials should have been provided).

Only package metadata ("envelopes" in our terminology) is downloaded at this point, the actual blobs will be downloaded later during installation

func FSMSpec

func FSMSpec(config install.FSMConfig) fsm.FSMSpecFunc

FSMSpec returns a function that returns an appropriate phase executor based on the provided params

func NewClusterFactory

func NewClusterFactory(config Config, base engine.ClusterFactory) engine.ClusterFactory

NewClusterFactory returns a factory for creating cluster requests

func NewFSMFactory

func NewFSMFactory(config Config) engine.FSMFactory

NewFSMFactory returns a new state machine factory

func NewProcessConfig

func NewProcessConfig(config ProcessConfig) (*processconfig.Config, error)

NewProcessConfig creates a gravity process config from installer config

func RegisterAgentLoop

func RegisterAgentLoop(p RegisterAgentParams)

RegisterAgentLoop makes a request to an Ops Center periodically to register this agent process in an install group.

It is used in Ops Center initiated installations to help install agents distribute the roles of installer/joining agents between themselves. The registration loop is canceled when the operation starts.

Types

type Config

type Config struct {
	// Config is the base installer configuration
	ossinstall.Config
	// License is optional license string
	License string
	// RemoteOpsURL is the URL of the remote Ops Center
	RemoteOpsURL string
	// RemoteOpsToken is the remote Ops Center auth token
	RemoteOpsToken string
	// OperationID is the ID of the operation when installing via Ops Center
	OperationID string
	// OpsTunnelToken is the token used when creating a trusted cluster
	OpsTunnelToken string
	// OpsSNIHost is the Ops Center SNI host
	OpsSNIHost string
	// OpsAdvertiseAddr is the Ops Center advertise address
	OpsAdvertiseAddr string
}

Config defines the installer configuration

func (*Config) CheckAndSetDefaults

func (c *Config) CheckAndSetDefaults() error

CheckAndSetDefaults checks the parameters and sets some defaults

type PlanBuilder

type PlanBuilder struct {
	*ossinstall.PlanBuilder
}

PlanBuilder extends the open-source plan builder

func (*PlanBuilder) AddConnectPhase

func (b *PlanBuilder) AddConnectPhase(plan *storage.OperationPlan, trustedCluster storage.TrustedCluster) error

AddConnectPhase appends Ops Center connect phase to the provided plan

func (*PlanBuilder) AddDecryptPhase

func (b *PlanBuilder) AddDecryptPhase(plan *storage.OperationPlan, encryptionKey string)

AddDecryptPhase appends package decryption phase to the provided plan

func (*PlanBuilder) AddInstallerPhase

func (b *PlanBuilder) AddInstallerPhase(plan *storage.OperationPlan, opsCluster, opsURL, opsToken string)

AddInstallerPhase appends installer download phase to the provided plan

func (*PlanBuilder) AddLicensePhase

func (b *PlanBuilder) AddLicensePhase(plan *storage.OperationPlan, license string)

AddLicensePhase appends license installation phase to the provided plan

type Planner

type Planner struct {
	// FieldLogger specifies the logger
	log.FieldLogger
	// PlanBuilderGetter creates a plan builder
	ossinstall.PlanBuilderGetter
	// Packages specifies the package service
	Packages pack.PackageService
	// PreflightChecks specifies whether to include preflight checks step
	PreflightChecks bool
	// OpsCenterCluster specifies the name of the remote Ops Center
	OpsCenterCluster string
	// OpsTunnelToken is the token used when creating a trusted cluster
	OpsTunnelToken string
	// OpsSNIHost is the Ops Center SNI host
	OpsSNIHost string
	// RemoteOpsURL is the URL of the remote Ops Center
	RemoteOpsURL string
	// RemoteOpsToken is the remote Ops Center auth token
	RemoteOpsToken string
}

Planner builds an install operation plan

func (*Planner) GetOperationPlan

func (r *Planner) GetOperationPlan(operator ops.Operator, cluster ops.Site, operation ops.SiteOperation) (*storage.OperationPlan, error)

GetOperationPlan builds a plan for the provided operation

type ProcessConfig

type ProcessConfig struct {
	// ProcessConfig specifies base process configuration
	ossinstall.ProcessConfig
	// OpsAdvertiseAddr is the Ops Center advertise address
	OpsAdvertiseAddr string
	// OpsSNIHost is the Ops Center SNI host
	OpsSNIHost string
}

ProcessConfig defines the configuration for the wizard process

type RegisterAgentParams

type RegisterAgentParams struct {
	// Context can be used to cancel registration loop
	Context context.Context
	// Request is the registration request to send to Ops Center
	Request ops.RegisterAgentRequest
	// OriginalResponse is the response to the first registration attempt
	OriginalResponse ops.RegisterAgentResponse
	// Operator is the Ops Center ops service
	Operator ops.Operator
}

RegisterAgentParams combines parameters needed for registering agent with an Ops Center

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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