Documentation ¶
Overview ¶
Package kubectl implements helper functions for managing kubernetes resources in e2e tests
This package borrows some code from https://github.com/grafana/xk6-kubernetes
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the state to access kubernetes
func NewForConfig ¶
NewForConfig returns a new Client using a rest.Config
func NewFromKubeconfig ¶
NewFromKubeconfig returns a new Client using the kubeconfig pointed by the path provided
func (*Client) ForwardPodPort ¶ added in v0.3.4
func (c *Client) ForwardPodPort( ctx context.Context, namespace string, pod string, port uint, opts ...PortForwardOption, ) (uint, error)
ForwardPodPort opens a local port for forwards requests to a pod's port. Returns the local port used for listening
type PortForwardOption ¶ added in v0.3.4
type PortForwardOption func(portForwardConfig) portForwardConfig
PortForwardOption defines a configuration option for port forwarding
func WithLocalPort ¶ added in v0.3.4
func WithLocalPort(port uint) PortForwardOption
WithLocalPort sets the local port to listen for request. Defaults to 0 (random local port)
func WithOutputStreams ¶ added in v0.3.4
func WithOutputStreams(stdout io.Writer, stderr io.Writer) PortForwardOption
WithOutputStreams sets the output streams for the port forwarder. Default to nil