k8s

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clientset

type Clientset struct {
	kubernetes.Interface
	// contains filtered or unexported fields
}

Clientset knows how to interact with a K8s cluster. It has a reference to user configuration stored in viper.

func NewClientset

func NewClientset(appConfig *config.Config, k8sConfig *rest.Config, logger *log.Logger) (*Clientset, error)

NewClientset returns a new Clientset for the given config.

func (*Clientset) CanExec

func (c *Clientset) CanExec() error

CanExec determines if the current user can create a exec subresource in the given pod.

func (*Clientset) ExecPod

func (c *Clientset) ExecPod(command []string, stdin io.Reader, stdout, stderr io.Writer, tty bool) error

ExecPod issues an exec request to execute the given command to a particular pod.

type ReadCloser

type ReadCloser struct {
	*bytes.Buffer
}

ReadCloser implements the io.ReadCloser interface. It provides a Close() method to the io.Reader type, so that callers like k8s.ExecPod() can close the stdin stream when done.

func NewReadCloser

func NewReadCloser(r io.Reader) (*ReadCloser, error)

func (*ReadCloser) Close

func (r *ReadCloser) Close() error

Close closes the underlying buffer of r by resetting it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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