operatorkclient

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientConfig

func GetClientConfig() *rest.Config

func GetPodContainerLogs

func GetPodContainerLogs(ctx context.Context, namespace string, podName string, containerName string, sinceTime *metav1.Time) (string, error)

func InitializeOperatorCoreClientSet

func InitializeOperatorCoreClientSet()

func RunCommandInPod

func RunCommandInPod(command, containerName, podName, namespace string, stdin io.Reader) (string, string, error)

RunCommandInPod runs a command in a container with default 10 sec timeout

func RunCommandInPodWithContextAndTimeout

func RunCommandInPodWithContextAndTimeout(ctx context.Context, timeout time.Duration, command, containerName, podName, namespace string, stdin io.Reader) (string, string, error)

func RunCommandInPodWithOptions added in v0.1.7

func RunCommandInPodWithOptions(options RunCommandInPodOptions) (string, string, error)

RunCommandInPodWithOptions returns stdout, stderr, err after running a command

func RunCommandInPodWithTimeout

func RunCommandInPodWithTimeout(timeout time.Duration, command, containerName, podName, namespace string, stdin io.Reader) (string, string, error)

RunCommandInPodWithTimeout runs a command in a container with specified timeout. Timeout can't be less 1ms

Types

type RunCommandInPodOptions added in v0.1.7

type RunCommandInPodOptions struct {
	// Background context will be used if not set
	Context context.Context
	// Default value is 10 seconds if not set
	Timeout time.Duration
	// Command to be run
	Command       string
	PodName       string
	PodNamespace  string
	ContainerName string
	Stdin         io.Reader
	Stderr        io.Writer
	Stdout        io.Writer
}

Jump to

Keyboard shortcuts

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