proxy

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(ctx context.Context, clientset kubernetes.Interface, restConfig *rest.Config, addr Addr) (net.Listener, error)

Listen creates a listener which returns new connections whenever someone connects to a socat or mock driver proxy instance running inside the given pod.

socat must by started with "<listen>,fork TCP-LISTEN:<port>,reuseport" for this to work. "<listen>" can be anything that accepts connections, for example "UNIX-LISTEN:/csi/csi.sock". In this mode, socat will accept exactly one connection on the given port for each connection that socat itself accepted.

Listening stops when the context is done or Close() is called.

Types

type Addr

type Addr struct {
	Namespace, PodName, ContainerName string
	Port                              int
}

Addr contains all relevant parameters for a certain port in a pod. The container must be running before connections are attempted.

func (Addr) Network

func (a Addr) Network() string

func (Addr) String

func (a Addr) String() string

type PodDirIO

type PodDirIO struct {
	F             *framework.Framework
	Namespace     string
	PodName       string
	ContainerName string
}

func (PodDirIO) DirExists

func (p PodDirIO) DirExists(path string) (bool, error)

func (PodDirIO) Mkdir

func (p PodDirIO) Mkdir(path string) error

func (PodDirIO) RemoveAll

func (p PodDirIO) RemoveAll(path string) error

Jump to

Keyboard shortcuts

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