dispatcher

package
v0.0.0-...-153285a Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HelpFlags = []string{"-h", "--help"}

Functions

func Execute

func Execute(clientVersion version.Info)

Execute is the entry point to the dispatcher. It passes in the current client version, which is used to determine if a delegation is necessary. If this function successfully delegates, then it will NOT return, since the current process will be overwritten (see execve(2)). If this function does not delegate, it merely falls through. This function assumes logging has been initialized before it is run; otherwise, log statements will not work.

Types

type Dispatcher

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

func NewDispatcher

func NewDispatcher(args []string, env []string,
	clientVersion version.Info,
	filepathBuilder *filepath.FilepathBuilder) *Dispatcher

NewDispatcher returns a new pointer to a Dispatcher struct.

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch() error

Dispatch attempts to execute a matching version of kubectl based on the version of the APIServer. If successful, this method will not return, since current process will be overwritten (see execve(2)). Otherwise, this method returns an error describing why the execution could not happen.

func (*Dispatcher) GetArgs

func (d *Dispatcher) GetArgs() []string

GetArgs returns a copy of the slice of strings representing the command line arguments.

func (*Dispatcher) GetClientVersion

func (d *Dispatcher) GetClientVersion() version.Info

func (*Dispatcher) GetEnv

func (d *Dispatcher) GetEnv() []string

GetEnv returns a copy of the slice of environment variables.

func (*Dispatcher) InitKubeConfigFlags

func (d *Dispatcher) InitKubeConfigFlags() (*genericclioptions.ConfigFlags, error)

InitKubeConfigFlags returns the ConfigFlags struct filled in with kube config values parsed from command line arguments. These flag values can affect the server version query. Therefore, the set of kubeConfigFlags MUST match the set used in the regular kubectl binary.

Jump to

Keyboard shortcuts

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