state

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 12 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 RunModeEnum

type RunModeEnum bool
const (
	RunSequentially RunModeEnum = false
	RunParallel     RunModeEnum = true
)

type State

type State struct {
	Cluster                   *kubeoneapi.KubeOneCluster
	Logger                    logrus.FieldLogger
	Connector                 *ssh.Connector
	Configuration             *configupload.Configuration
	Runner                    *runner.Runner
	Context                   context.Context
	WorkDir                   string
	JoinCommand               string
	JoinToken                 string
	RESTConfig                *rest.Config
	DynamicClient             dynclient.Client
	Verbose                   bool
	BackupFile                string
	DestroyWorkers            bool
	RemoveBinaries            bool
	ForceUpgrade              bool
	ForceInstall              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(ctx context.Context) (*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 RunModeEnum) error

RunTaskOnAllNodes runs the given task on all hosts.

func (*State) RunTaskOnControlPlane

func (s *State) RunTaskOnControlPlane(task NodeTask, parallel RunModeEnum) error

func (*State) RunTaskOnFollowers

func (s *State) RunTaskOnFollowers(task NodeTask, parallel RunModeEnum) 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 RunModeEnum) error

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

func (*State) RunTaskOnStaticWorkers

func (s *State) RunTaskOnStaticWorkers(task NodeTask, parallel RunModeEnum) error

Jump to

Keyboard shortcuts

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