k8s

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(opts TransportOpts) (it.Transport, error)

NewTransport takes transport opts and return a new instance of the kubernetes transport.

Types

type Transport

type Transport struct {
	Client    kubernetes.Client
	Namespace string
	Pod       string
	Container string
}

Transport is the kubernetes transport. It's public because sometimes callers need to access the raw client and data.

func (Transport) Close

func (t Transport) Close() error

func (Transport) Copy

func (t Transport) Copy(ctx context.Context, src it.Copyable, dst string) error

Copy copies the copyable src to the dst on a Pod as specified in the transport options.

func (Transport) Run

func (t Transport) Run(ctx context.Context, cmd it.Command) (stdout, stderr string, err error)

Run runs the provided command on a remote Pod as specified th in the transport config. Run blocks until the command execution has completed.

func (Transport) Stream

func (t Transport) Stream(ctx context.Context, command it.Command) (stdout, stderr io.Reader, errC chan error)

Stream runs the provided command on a remote Pod and streams the results. Stream does not block and is done when the error channel has either an error or nil.

func (Transport) Type

func (t Transport) Type() it.TransportType

type TransportOpts

type TransportOpts struct {
	KubeConfigBase64 string
	ContextName      string
	Namespace        string
	Pod              string
	Container        string
}

TransportOpts are the options required in order to create the k8s transport.

Jump to

Keyboard shortcuts

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