state

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeTask

type NodeTask func(ctx *State, node *kubeoneapi.HostConfig, conn ssh.Connection) error

NodeTask is a task that is specifically tailored to run on a single node.

type State

type State struct {
	Cluster                   *kubeoneapi.KubeOneCluster
	Logger                    logrus.FieldLogger
	Connector                 *ssh.Connector
	Configuration             *configupload.Configuration
	Runner                    *runner.Runner
	WorkDir                   string
	JoinCommand               string
	JoinToken                 string
	RESTConfig                *rest.Config
	DynamicClient             dynclient.Client
	Verbose                   bool
	BackupFile                string
	DestroyWorkers            bool
	RemoveBinaries            bool
	ForceUpgrade              bool
	UpgradeMachineDeployments bool
	PatchCNI                  bool
	CredentialsFilePath       string
	ManifestFilePath          string
}

State holds together currently test flags and parsed info, along with utilities like logger

func New

func New() (*State, error)

func (*State) Clone

func (s *State) Clone() *State

Clone returns a shallow copy of the State.

func (*State) KubeadmVerboseFlag

func (s *State) KubeadmVerboseFlag() string

func (*State) RunTaskOnAllNodes

func (s *State) RunTaskOnAllNodes(task NodeTask, parallel bool) error

RunTaskOnAllNodes runs the given task on all hosts.

func (*State) RunTaskOnFollowers

func (s *State) RunTaskOnFollowers(task NodeTask, parallel bool) error

RunTaskOnFollowers runs the given task on the follower hosts.

func (*State) RunTaskOnLeader

func (s *State) RunTaskOnLeader(task NodeTask) error

RunTaskOnLeader runs the given task on the leader host.

func (*State) RunTaskOnNodes

func (s *State) RunTaskOnNodes(nodes []kubeoneapi.HostConfig, task NodeTask, parallel bool) error

RunTaskOnNodes runs the given task on the given selection of hosts.

Jump to

Keyboard shortcuts

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