state

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemDStatusUnknown    = 1 << iota // systemd unit unknown
	SystemdDStatusDead                  // systemd unit dead
	SystemDStatusRestarting             // systemd unit restarting
	ComponentInstalled                  // installed (package, or direct download)
	SystemDStatusActive                 // systemd unit is activated
	SystemDStatusRunning                // systemd unit is running
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	ControlPlane []Host
	Workers      []Host
	Lock         sync.Mutex
}

func (*Cluster) Healthy

func (c *Cluster) Healthy() bool

type ComponentStatus

type ComponentStatus struct {
	Version *semver.Version
	Status  int64
}

func (*ComponentStatus) Healthy

func (cs *ComponentStatus) Healthy() bool

type Host

type Host struct {
	ContainerRuntime ComponentStatus
	Hostname         string
	IsInCluster      bool
	Kubeconfig       []byte
	Kubernetes       ComponentStatus
	OS               kubeone.OperatingSystemName
	PrivateAddress   string
	PublicAddress    string
}

func (*Host) Healthy

func (h *Host) Healthy() bool

func (*Host) Ready

func (h *Host) Ready() bool

func (*Host) RestConfig

func (h *Host) RestConfig() (*rest.Config, error)

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
	LiveCluster               *Cluster
	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