podexec

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PodExec

type PodExec struct {
	K8sClient     *kubernetes.Clientset
	RESTConfig    *rest.Config
	Namespace     string
	PodName       string
	ContainerName string
	Command       []string
	Stdin         io.Reader
	Stdout        io.Writer
	Stderr        io.Writer
	Tty           bool
	NoPreserve    bool
}

func NewPodExec

func NewPodExec(namespace, podName, containerName string, restConfig *rest.Config, k8sClient *kubernetes.Clientset) *PodExec

func (*PodExec) Exec

func (p *PodExec) Exec() error

Exec 在给定容器中执行命令

func (*PodExec) FromPodContainer

func (p *PodExec) FromPodContainer(dest []string, style string) error

FromPodContainer 从pod内拷贝到io.Writer

func (*PodExec) ToPodContainer

func (p *PodExec) ToPodContainer(destPath string) error

ToPodContainer 从io.Writer拷贝到pod tar file ---> io.Writer ---> kubernetes api ---> io.Reader ---> unTar file

Jump to

Keyboard shortcuts

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