kubectl

package
v0.0.0-...-2c6f1e0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: UPL-1.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFilesFromPod

func CopyFilesFromPod(c *CopyConfig, waitMsg string) error

CopyFilesFromPod copies one or more remote files in a pod to local files. This function stops if an error occurs copying any of the files, and the remaining files are not copied.

func CopyFilesToPod

func CopyFilesToPod(c *CopyConfig, waitMsg string) error

CopyFilesToPod copies one or more files to a pod. This function stops if an error occurs copying any of the files, and the remaining files are not copied.

func RunCommand

func RunCommand(kc *KubectlConfig, podName string, cmdArgs ...string) error

func RunScript

func RunScript(kc *KubectlConfig, podName string, scriptDir string, scriptName string) error

RunScript runs a script on a pod

func SetLastAppliedConfigurationAnnotation

func SetLastAppliedConfigurationAnnotation(obj runtime.Object) error

SetLastAppliedConfigurationAnnotation applies the kubectl.kubernetes.io/last-applied-configuration annotation in order to calculate correct 3-way merges between object configuration file/configuration file, live object configuration/live configuration and declarative configuration writer/declarative writer

func SetPipes

func SetPipes(kc *KubectlConfig)

SetPipes connects the out and error streams of a KubectlConfig to write to pipes.

Types

type CopyConfig

type CopyConfig struct {
	*KubectlConfig
	FilePaths []FilePath
	PodName   string
}

CopyConfig contains information used to copy to and from the pod

type FilePath

type FilePath struct {
	RemotePath string
	LocalPath  string
}

type KubectlConfig

type KubectlConfig struct {
	ConfigFlags     *genericclioptions.ConfigFlags
	Streams         genericiooptions.IOStreams
	StreamOut       io.Reader
	StreamErr       io.Reader
	StreamOutWriter io.WriteCloser
	StreamErrWriter io.WriteCloser
	Namespace       string
	ErrBuf          *bytes.Buffer
	IgnoreErrors    []string
}

KubectlConfig contains information used access a pod via kubectl

func NewKubectlConfig

func NewKubectlConfig(restConfig *rest.Config, kubeConfigPath string, namespace string, ignoreErrors []string, usePipes bool) (*KubectlConfig, error)

NewKubectlConfig gets the configuration needed to use kubectl

Jump to

Keyboard shortcuts

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