dtest

package module
v0.0.0-...-722b199 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Kube20 = KubeVersion{20}
	Kube21 = KubeVersion{21}
	Kube22 = KubeVersion{22}

	KubeLatest = Kube22
)

Functions

func DockerRegistry

func DockerRegistry(ctx context.Context) string

DockerRegistry returns a docker registry suitable for use in tests.

func GetKubeconfig

func GetKubeconfig(ctx context.Context) string

GetKubeconfig returns the kubeconfig contents for the running k3s cluster as a string. It will return the empty string if no cluster is running.

func K3sDown

func K3sDown(ctx context.Context) string

K3sDown shuts down the k3s cluster.

func K3sUp

func K3sUp(ctx context.Context, k3sExtraFlags ...string) string

K3sUp will launch if necessary and return the docker id of a container running a k3s cluster.

func K3sVersionUp

func K3sVersionUp(ctx context.Context, kubeVersion KubeVersion, k3sExtraFlags ...string) string

func KubeVersionConfig

func KubeVersionConfig(ctx context.Context, kubeVersion KubeVersion, k3sExtraFlags ...string) string

func Kubeconfig

func Kubeconfig(ctx context.Context, k3sExtraFlags ...string) string

Kubeconfig returns a path referencing a kubeconfig file suitable for use in tests.

func RegistryDown

func RegistryDown(ctx context.Context) string

RegistryDown shutsdown the test registry.

func RegistryUp

func RegistryUp(ctx context.Context) string

RegistryUp will launch if necessary and return the docker id of a container running a docker registry.

func WithMachineLock

func WithMachineLock(ctx context.Context, body func(context.Context))

WithMachineLock executes the supplied body with a guarantee that it is the only code running (via WithMachineLock) on the machine.

func WithNamedMachineLock

func WithNamedMachineLock(ctx context.Context, name string, body func(context.Context))

WithNamedMachineLock executes the supplied body with a guarantee that it is the only code running (via WithMachineLock) on the machine. The name provides scope so this can be used in multiple independent ways without conflicts.

Types

type KubeVersion

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

Jump to

Keyboard shortcuts

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