install

package
v19.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EmptyValues corresponds to no values for the feature
	EmptyValues = map[string]interface{}{}
)

Functions

func ListFeatures

func ListFeatures(suitableFor string) ([]interface{}, error)

ListFeatures lists all features suitable for hosts or clusters

func UploadFile

func UploadFile(localpath string, host *pb.Host, remotepath, owner, group, rights string) (err error)

UploadFile uploads a file to remote host

func UploadStringToRemoteFile

func UploadStringToRemoteFile(content string, host *pb.Host, filename string, owner, group, rights string) error

UploadStringToRemoteFile creates a file 'filename' on remote 'host' with the content 'content'

Types

type ClusterTarget

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

ClusterTarget defines a target of type Host, satisfying TargetAPI

func (*ClusterTarget) Installed

func (t *ClusterTarget) Installed() []string

Installed returns a list of installed feature

func (*ClusterTarget) Methods

func (t *ClusterTarget) Methods() map[uint8]Method.Enum

Methods returns a list of packaging managers usable on the target

func (*ClusterTarget) Name

func (t *ClusterTarget) Name() string

Name returns the name of the cluster

func (*ClusterTarget) Type

func (t *ClusterTarget) Type() string

Type returns the type of the Target

type Feature

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

Feature contains the information about an installable feature

func NewEmbeddedFeature

func NewEmbeddedFeature(task concurrency.Task, name string) (_ *Feature, err error)

NewEmbeddedFeature searches for an embedded featured named 'name' and initializes a new Feature object with its content

func NewFeature

func NewFeature(task concurrency.Task, name string) (_ *Feature, err error)

NewFeature searches for a spec file name 'name' and initializes a new Feature object with its content

func (*Feature) Add

func (f *Feature) Add(t Target, v Variables, s Settings) (_ Results, err error)

Add installs the feature on the target Installs succeeds if error == nil and Results.Successful() is true

func (*Feature) Applyable

func (f *Feature) Applyable(t Target) bool

Applyable tells if the feature is installable on the target

func (*Feature) Check

func (f *Feature) Check(t Target, v Variables, s Settings) (_ Results, err error)

Check if feature is installed on target Check is ok if error is nil and Results.Successful() is true

func (*Feature) DisplayFilename

func (f *Feature) DisplayFilename() string

DisplayFilename returns the full file name, with [embedded] added at the end if the feature is embedded.

func (*Feature) DisplayName

func (f *Feature) DisplayName() string

DisplayName returns the name of the feature

func (*Feature) Filename

func (f *Feature) Filename() string

Filename returns the name of the feature

func (*Feature) Remove

func (f *Feature) Remove(t Target, v Variables, s Settings) (_ Results, err error)

Remove uninstalls the feature from the target

func (*Feature) Specs

func (f *Feature) Specs() *viper.Viper

Specs returns a copy of the spec file (we don't want external use to modify Feature.specs)

type HostTarget

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

HostTarget defines a target of type Host, satisfying TargetAPI

func (*HostTarget) Installed

func (t *HostTarget) Installed() []string

Installed returns a list of installed features

func (*HostTarget) Methods

func (t *HostTarget) Methods() map[uint8]Method.Enum

Methods returns a list of packaging managers usable on the target

func (*HostTarget) Name

func (t *HostTarget) Name() string

Name returns the name of the Target

func (*HostTarget) Type

func (t *HostTarget) Type() string

Type returns the type of the Target

type Installer

type Installer interface {
	// Check checks if the feature is installed
	Check(*Feature, Target, Variables, Settings) (Results, error)
	// Add executes installation of feature
	Add(*Feature, Target, Variables, Settings) (Results, error)
	// Remove executes deletion of feature
	Remove(*Feature, Target, Variables, Settings) (Results, error)
}

Installer defines the API of an Installer

func NewAptInstaller

func NewAptInstaller() Installer

NewAptInstaller creates a new instance of Installer using script

func NewBashInstaller

func NewBashInstaller() Installer

NewBashInstaller creates a new instance of Installer using script

func NewDcosInstaller

func NewDcosInstaller() Installer

NewDcosInstaller creates a new instance of Installer using DCOS

func NewDnfInstaller

func NewDnfInstaller() Installer

NewDnfInstaller creates a new instance of Installer using script

func NewYumInstaller

func NewYumInstaller() Installer

NewYumInstaller creates a new instance of Installer using script

type KongController

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

KongController allows to control Kong, installed on a host

func NewKongController

func NewKongController(svc iaas.Service, network *resources.Network, addressPrimaryGateway bool) (*KongController, error)

NewKongController ... func NewKongController(host *pb.Host) (*KongController, error) {

func (*KongController) Apply

func (k *KongController) Apply(rule map[interface{}]interface{}, values *Variables) (string, error)

Apply applies the rule to Kong proxy Currently, support rule types service, route and upstream Returns rule name and error

type NodeTarget

type NodeTarget struct {
	*HostTarget
}

NodeTarget defines a target of type Node of cluster, including a master

func (*NodeTarget) Type

func (t *NodeTarget) Type() string

Type returns the type of the Target

type Results

type Results map[string]StepResults

Results ...

func (Results) AllErrorMessages

func (r Results) AllErrorMessages() string

AllErrorMessages ...

func (Results) ErrorMessagesOfHost

func (r Results) ErrorMessagesOfHost(name string) string

ErrorMessagesOfHost ...

func (Results) ErrorMessagesOfStep

func (r Results) ErrorMessagesOfStep(name string) string

ErrorMessagesOfStep ...

func (Results) Keys

func (r Results) Keys() []string

Keys returns the keys of the Results

func (Results) ResultsOfStep

func (r Results) ResultsOfStep(name string) StepResults

ResultsOfStep ...

func (Results) Successful

func (r Results) Successful() bool

Successful ...

func (Results) Transpose

func (r Results) Transpose() Results

Transpose reorganizes Results to be indexed by hosts (instead by steps normally)

type Settings

type Settings struct {
	// SkipProxy to tell not to try to set reverse proxy
	SkipProxy bool
	// Serialize force not to parallel hosts in step
	Serialize bool
	// SkipFeatureRequirements tells not to install required features
	SkipFeatureRequirements bool
	// SkipSizingRequirements tells not to check sizing requirements
	SkipSizingRequirements bool
	// AddUnconditionally tells to not check before addition (no effect for check or removal)
	AddUnconditionally bool
}

Settings are used to tune the feature

type StepResults

type StepResults map[string]stepResult

StepResults contains the errors of the step for each host target

func (StepResults) Completed

func (s StepResults) Completed() bool

Completed tells if all the scripts corresponding to action have been completed.

func (StepResults) ErrorMessages

func (s StepResults) ErrorMessages() string

ErrorMessages returns a string containing all the errors registered

func (StepResults) Successful

func (s StepResults) Successful() bool

Successful tells if all the steps have been successful

func (StepResults) UncompletedEntries

func (s StepResults) UncompletedEntries() []string

UncompletedEntries returns an array of string of all keys where the script to run action wasn't completed

type Target

type Target interface {
	// Name returns the name of the target
	Name() string
	// Type returns the name of the target
	Type() string
	// Methods returns a list of installation methods usable on the target, ordered from
	// upper to lower priority (1 = highest priority)
	Methods() map[uint8]Method.Enum
	// Installed returns a list of installed features
	Installed() []string
}

Target is an interface that target must satisfy to be able to install something on it

func NewClusterTarget

func NewClusterTarget(task concurrency.Task, cluster clusterapi.Cluster) (Target, error)

NewClusterTarget ...

func NewHostTarget

func NewHostTarget(host *pb.Host) (Target, error)

NewHostTarget ...

func NewNodeTarget

func NewNodeTarget(host *pb.Host) (Target, error)

NewNodeTarget ...

type Variables

type Variables map[string]interface{}

Variables defines the parameters a Installer may need

func (Variables) Clone

func (v Variables) Clone() Variables

Clone clones the content of a Variables

Directories

Path Synopsis
enums

Jump to

Keyboard shortcuts

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