util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFromYAML

func CreateFromYAML(ctx context.Context, kc *kubernetes.Clientset, rc *rest.Config, filename string) error

func CreateResources

func CreateResources(ctx context.Context, resources []*unstructured.Unstructured, kc *kubernetes.Clientset, client *dynamic.DynamicClient) error

func GetDynamicClient

func GetDynamicClient(rc *rest.Config) (*dynamic.DynamicClient, error)

func GetJoinToken

func GetJoinToken(kc *kubernetes.Clientset, rc *rest.Config, name string, namespace string) (string, error)

func GetKMCClientSet

func GetKMCClientSet(ctx context.Context, kc *kubernetes.Clientset, name string, namespace string, port int) (*kubernetes.Clientset, error)

GetKMCClientSet returns a kubernetes clientset for the cluster given the name and the namespace of the cluster.k0smotron.io

func GetNodeAddress

func GetNodeAddress(ctx context.Context, kc *kubernetes.Clientset, node string) (string, error)

func InstallK0smotronOperator

func InstallK0smotronOperator(ctx context.Context, kc *kubernetes.Clientset, rc *rest.Config) error

func NewSuiteContext added in v0.4.1

func NewSuiteContext(t *testing.T) (context.Context, context.CancelCauseFunc)

func ParseManifests

func ParseManifests(data []byte) ([]*unstructured.Unstructured, error)

func WaitForSecret added in v0.4.1

func WaitForSecret(ctx context.Context, kc *kubernetes.Clientset, name string, namespace string) error

Types

type ErrorHandler

type ErrorHandler func(err error, msgAndArgs ...interface{})

type PortForwarder

type PortForwarder struct {
	ReadyChan chan struct{}
	// contains filtered or unexported fields
}

func GetPortForwarder

func GetPortForwarder(cfg *rest.Config, name string, namespace string, port int) (*PortForwarder, error)

func (*PortForwarder) Close

func (pf *PortForwarder) Close()

Close closes the forwarder

func (*PortForwarder) LocalPort added in v0.4.0

func (pf *PortForwarder) LocalPort() (int, error)

Get the local port that is forwarded to the remote port

func (*PortForwarder) Start

func (pf *PortForwarder) Start(errorHandler ErrorHandler)

Start runs ForwardPorts. The errorHandler is expected to be s.Require().NoError

Jump to

Keyboard shortcuts

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