clients

package
v0.0.0-...-5dac8ea Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewSPDYExecutor = remotecommand.NewSPDYExecutor

Functions

func ClearClientSet

func ClearClientSet()

Types

type Clientset

type Clientset struct {
	RestConfig      *rest.Config
	DynamicClient   dynamic.Interface
	OcpClient       ocpconfig.Interface
	K8sClient       kubernetes.Interface
	K8sRestClient   rest.Interface
	KubeConfigPaths []string
	// contains filtered or unexported fields
}

A Clientset contains clients for the different k8s API groups in one place

func GetClientset

func GetClientset(kubeconfigPaths ...string) (*Clientset, error)

GetClientset returns the singleton clientset object.

func (*Clientset) FindPodNameFromPrefix

func (clientsholder *Clientset) FindPodNameFromPrefix(namespace, prefix string) (string, error)

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd(key, cmd string) (*Cmd, error)

func (*Cmd) ExtractResult

func (c *Cmd) ExtractResult(s string) (map[string]string, error)

func (*Cmd) GetCommand

func (c *Cmd) GetCommand() string

func (*Cmd) SetOutputProcessor

func (c *Cmd) SetOutputProcessor(f func(string) (string, error))

type CmdGroup

type CmdGroup struct {
	// contains filtered or unexported fields
}

func (*CmdGroup) AddCommand

func (cgrp *CmdGroup) AddCommand(c *Cmd)

func (*CmdGroup) ExtractResult

func (cgrp *CmdGroup) ExtractResult(s string) (map[string]string, error)

func (*CmdGroup) GetCommand

func (cgrp *CmdGroup) GetCommand() string

type Cmder

type Cmder interface {
	GetCommand() string
	ExtractResult(string) (map[string]string, error)
}

type ContainerCreationExecContext

type ContainerCreationExecContext struct {
	*ContainerExecContext
	// contains filtered or unexported fields
}

ContainerExecContext encapsulates the context in which a command is run; the namespace, pod, and container.

func NewContainerCreationExecContext

func NewContainerCreationExecContext(
	clientset *Clientset,
	namespace, podName, containerName, containerImage string,
	labels map[string]string,
	command []string,
	containerSecurityContext *corev1.SecurityContext,
	hostNetwork bool,
	volumes []*Volume,
) (*ContainerCreationExecContext, error)

func (*ContainerCreationExecContext) CreatePodAndWait

func (c *ContainerCreationExecContext) CreatePodAndWait() error

func (*ContainerCreationExecContext) DeletePodAndWait

func (c *ContainerCreationExecContext) DeletePodAndWait() error

type ContainerExecContext

type ContainerExecContext struct {
	// contains filtered or unexported fields
}

ContainerExecContext encapsulates the context in which a command is run; the namespace, pod, and container.

func NewContainerContext

func NewContainerContext(
	clientset *Clientset,
	namespace, podNamePrefix, containerName string,
) (*ContainerExecContext, error)

func (*ContainerExecContext) ExecCommand

func (c *ContainerExecContext) ExecCommand(command []string) (stdout, stderr string, err error)

ExecCommand runs command in a container and returns output buffers

func (*ContainerExecContext) ExecCommandStdIn

func (c *ContainerExecContext) ExecCommandStdIn(command []string, buffIn bytes.Buffer) (stdout, stderr string, err error)

func (*ContainerExecContext) GetContainerName

func (c *ContainerExecContext) GetContainerName() string

func (*ContainerExecContext) GetNamespace

func (c *ContainerExecContext) GetNamespace() string

func (*ContainerExecContext) GetPodName

func (c *ContainerExecContext) GetPodName() string

type ExecContext

type ExecContext interface {
	ExecCommand([]string) (string, string, error)
	ExecCommandStdIn([]string, bytes.Buffer) (string, string, error)
}

type Volume

type Volume struct {
	VolumeSource corev1.VolumeSource
	Name         string
	MountPath    string
}

Jump to

Keyboard shortcuts

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