kubectlcmd

package
v1.1.0-beta27 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cat

func Cat(client kube.ExtendedClient, 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 EnvoyGet

func EnvoyGet(client kube.ExtendedClient, 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 Exec

func Exec(client kube.ExtendedClient, namespace, pod, container, cmdStr string, dryRun bool) (string, error)

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

func Logs

func Logs(client kube.ExtendedClient, namespace, pod, container string, previous, dryRun bool) (string, error)

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

func Run

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

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

func RunCmd

func RunCmd(command, namespace string, dryRun bool) (string, error)

RunCmd runs the given command in kubectl, adding -n namespace if namespace is not 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.

Jump to

Keyboard shortcuts

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