pod

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logs added in v0.9.0

func Logs(ctx context.Context, client kubernetes.Interface, namespace, pod, container string) (output string, err error)

Retrieves a container log, with retry in case of errors. It is okay if the pod does not exist yet.

func NewTransport added in v1.0.0

func NewTransport(logger logr.Logger, client kubernetes.Interface, restConfig *rest.Config) *http.Transport

NewTransport creates a transport which uses the port forward dialer. URLs must use <namespace>.<pod>:<port> as host.

func RunInPod

func RunInPod(f *framework.Framework, rootdir string, files []string, command string, namespace, pod, container string) (string, string)

RunInPod optionally transfers some files into /tmp (source file relative to root dir, with same base file name, without path, with same x bit) and executes a shell command. Any error is treated as test failure.

Relies on dd in the target container.

Types

type Addr added in v1.0.0

type Addr struct {
	Namespace, PodName string
	Port               int
}

Addr contains all relevant parameters for a certain port in a pod. The container should be running before connections are attempted, otherwise the connection will fail.

func ParseAddr added in v1.0.0

func ParseAddr(addr string) (*Addr, error)

func (Addr) Network added in v1.0.0

func (a Addr) Network() string

func (Addr) String added in v1.0.0

func (a Addr) String() string

type Dialer added in v1.0.0

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

Dialer holds the relevant parameters that are independent of a particular connection.

func NewDialer added in v1.0.0

func NewDialer(client kubernetes.Interface, restConfig *rest.Config) *Dialer

NewDialer creates a dialer that supports connecting to container ports.

func (*Dialer) DialContainerPort added in v1.0.0

func (d *Dialer) DialContainerPort(ctx context.Context, logger logr.Logger, addr Addr) (conn net.Conn, finalErr error)

DialContainerPort connects to a certain container port in a pod.

type LocalAddr added in v1.0.0

type LocalAddr struct{}

func (LocalAddr) Network added in v1.0.0

func (l LocalAddr) Network() string

func (LocalAddr) String added in v1.0.0

func (l LocalAddr) String() string

Jump to

Keyboard shortcuts

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