v0.0.0-...-9e676ce Latest Latest

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

Go to latest
Published: Jun 5, 2024 License: EPL-2.0 Imports: 10 Imported by: 0




View Source
const (
	Pods = "pods"
	Exec = "exec"
	Post = "POST"

	ContainerName = "containerName"
	PodName       = "podName"


This section is empty.


This section is empty.


type InfoExec

type InfoExec interface {
	// Spawn info exec inside container. Return error in
	// case fail exec creation or fail command.
	Start() (err error)
	// Get output with exec command information.
	GetOutput() (output string)

InfoExec - exec to spawn some simple not shell based command which returns output with some useful information.

type InfoExecCreator

type InfoExecCreator interface {
	// Create new info exec. Return error in case fail.
	CreateInfoExec(command []string, containerInfo *model.ContainerInfo) (infoExec InfoExec)

InfoExecCreator - factory for InfoExec creation.

type KubernetesInfoExec

type KubernetesInfoExec struct {
	// contains filtered or unexported fields

Exec to get some information from container. Command for such exec should be simple(For example: "whoami", "arch", "env") and completable otherwise it will be timeout in 3 seconds. This exec is always not "tty" and doesn't provide sending input to the command.

func NewKubernetesInfoExec

func NewKubernetesInfoExec(
	command []string,
	containerName string,
	podName string,
	namespace string,
	core v1.CoreV1Interface,
	config *rest.Config) *KubernetesInfoExec

Create new kubernetes exec.

func (*KubernetesInfoExec) GetOutput

func (exec *KubernetesInfoExec) GetOutput() string

Get exec output content.

func (*KubernetesInfoExec) Start

func (exec *KubernetesInfoExec) Start() (err error)

Start new kubernetes info exec.

type KubernetesInfoExecCreator

type KubernetesInfoExecCreator struct {
	// contains filtered or unexported fields

Component to creation new info execs on the kubernetes infrastructure.

func NewKubernetesInfoExecCreator

func NewKubernetesInfoExecCreator(
	namespace string,
	core v1.CoreV1Interface,
	config *rest.Config) *KubernetesInfoExecCreator

Return new instance of the kubernetes info exec creator.

func (*KubernetesInfoExecCreator) CreateInfoExec

func (creator *KubernetesInfoExecCreator) CreateInfoExec(command []string, containerInfo *model.ContainerInfo) InfoExec

Create new kubernetes info exec.

Jump to

Keyboard shortcuts

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