kubectlcmd

package
v0.0.0-...-307b342 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Path to the kubeconfig file.
	Kubeconfig string
	// ComponentName of the kubeconfig context to use.
	Context string

	// namespace - k8s namespace for Run command
	Namespace string

	// DryRun performs all steps but only logs the Run command without running it.
	DryRun bool
	// Maximum amount of time to wait for resources to be ready after install when Wait=true.
	WaitTimeout time.Duration

	// output - output mode for Run i.e. --output.
	Output string

	// extraArgs - more args to be added to the Run command, which are appended to
	// the end of the Run command.
	ExtraArgs []string
}

Options contains the Run options.

type Runner

type Runner struct {
	Client kube.CLIClient
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(activeRqLimit int) *Runner

func (*Runner) Cat

func (r *Runner) Cat(namespace, pod, container, path string, dryRun bool) (string, error)

Cat runs the cat command for the given path in the given namespace/pod/container.

func (*Runner) EnvoyGet

func (r *Runner) EnvoyGet(namespace, pod, url string, dryRun bool) (string, error)

EnvoyGet sends a GET request for the URL in the Envoy container in the given namespace/pod and returns the result.

func (*Runner) Exec

func (r *Runner) Exec(namespace, pod, container, cmdStr string, dryRun bool) (string, error)

Exec runs exec for the given command in the given namespace/pod/container.

func (*Runner) Logs

func (r *Runner) Logs(namespace, pod, container string, previous, dryRun bool) (string, error)

Logs returns the logs for the given namespace/pod/container.

func (*Runner) ReportRunningTasks

func (r *Runner) ReportRunningTasks()

func (*Runner) Run

func (r *Runner) Run(subcmds []string, opts *Options) (string, error)

Run runs the kubectl command by specifying subcommands in subcmds with opts.

func (*Runner) RunCmd

func (r *Runner) RunCmd(command, namespace, kubeConfig, kubeContext string, dryRun bool) (string, error)

RunCmd runs the given command in kubectl, adding -n namespace if namespace is not empty.

func (*Runner) SetClient

func (r *Runner) SetClient(client kube.CLIClient)

Jump to

Keyboard shortcuts

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