Documentation ¶
Index ¶
- func BuildKubernetesClientset(ctx *Context) error
- func DownloadKubeconfig(cluster *config.Cluster) ([]byte, error)
- func IsRunning(stdout string) bool
- func MakeShellCommand(cmd string, variables TemplateVariables) (string, error)
- type Configuration
- func (c *Configuration) AddFile(filename string, content string)
- func (c *Configuration) Backup(target string) error
- func (c *Configuration) Debug()
- func (c *Configuration) Download(conn ssh.Connection, source string, prefix string) error
- func (c *Configuration) Get(filename string) (string, error)
- func (c *Configuration) UploadTo(conn ssh.Connection, directory string) error
- type Context
- func (c *Context) Clone() *Context
- func (c *Context) RunTaskOnAllNodes(task NodeTask, parallel bool) error
- func (c *Context) RunTaskOnFollowers(task NodeTask, parallel bool) error
- func (c *Context) RunTaskOnLeader(task NodeTask) error
- func (c *Context) RunTaskOnNodes(nodes []*config.HostConfig, task NodeTask, parallel bool) error
- type NodeTask
- type Runner
- type Tee
- type TemplateVariables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKubernetesClientset ¶
BuildKubernetesClientset builds core kubernetes and apiextensions clientsets
func DownloadKubeconfig ¶
DownloadKubeconfig downloads Kubeconfig over SSH
func IsRunning ¶
IsRunning checks if the given output represents the "Running" status of a Kubernetes pod.
func MakeShellCommand ¶
func MakeShellCommand(cmd string, variables TemplateVariables) (string, error)
MakeShellCommand render text template with given `variables` render-context
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration holds a map of generated files
func (*Configuration) AddFile ¶
func (c *Configuration) AddFile(filename string, content string)
AddFile save file contents for future references
func (*Configuration) Backup ¶
func (c *Configuration) Backup(target string) error
Backup dumps the files into a .tar.gz archive.
func (*Configuration) Debug ¶
func (c *Configuration) Debug()
Debug list filenames and their size to the standard output
func (*Configuration) Download ¶
func (c *Configuration) Download(conn ssh.Connection, source string, prefix string) error
Download a files matching `source` pattern
func (*Configuration) Get ¶
func (c *Configuration) Get(filename string) (string, error)
Get returns contents of the generated file by filename
func (*Configuration) UploadTo ¶
func (c *Configuration) UploadTo(conn ssh.Connection, directory string) error
UploadTo directory all the files
type Context ¶
type Context struct { Cluster *config.Cluster Logger logrus.FieldLogger Connector *ssh.Connector Configuration *Configuration Runner *Runner WorkDir string JoinCommand string JoinToken string Clientset *kubernetes.Clientset APIExtensionClientset *apiextensionsclientset.Clientset RESTConfig *rest.Config Verbose bool BackupFile string DestroyWorkers bool ForceUpgrade bool UpgradeMachineDeployments bool }
Context hold together currently test flags and parsed info, along with utilities like logger
func (*Context) RunTaskOnAllNodes ¶
RunTaskOnAllNodes runs the given task on all hosts.
func (*Context) RunTaskOnFollowers ¶
RunTaskOnFollowers runs the given task on the follower hosts.
func (*Context) RunTaskOnLeader ¶
RunTaskOnLeader runs the given task on the leader host.
func (*Context) RunTaskOnNodes ¶
RunTaskOnNodes runs the given task on the given selection of hosts.
type NodeTask ¶
type NodeTask func(ctx *Context, node *config.HostConfig, conn ssh.Connection) error
NodeTask is a task that is specifically tailored to run on a single node.
type Runner ¶
type Runner struct { Conn ssh.Connection Prefix string OS string Verbose bool }
Runner bundles a connection to a host with the verbosity and other options for running commands via SSH.
func (*Runner) Run ¶
Run executes a given command/script, optionally printing its output to stdout/stderr.
func (*Runner) WaitForCondition ¶
WaitForCondition waits for something to be true.
type Tee ¶
type Tee struct {
// contains filtered or unexported fields
}
Tee mimics the unix `tee` command by piping its input through to the upstream writer and also capturing it in a buffer.
type TemplateVariables ¶
type TemplateVariables map[string]interface{}
TemplateVariables is a render context for templates