Documentation ¶
Index ¶
- func DockerRegistry() string
- func GetKubeconfig() string
- func K3sDown() string
- func K3sUp() string
- func K8sApply(files ...string)
- func Kubeconfig() string
- func RegistryDown() string
- func RegistryUp() string
- func Sudo()
- func WithMachineLock(body func())
- func WithNamedMachineLock(name string, body func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerRegistry ¶
func DockerRegistry() string
DockerRegistry returns a docker registry suitable for use in tests.
func GetKubeconfig ¶
func GetKubeconfig() 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 K3sUp ¶
func K3sUp() string
K3sUp will launch if necessary and return the docker id of a container running a k3s cluster.
func K8sApply ¶
func K8sApply(files ...string)
K8sApply applies the supplied manifests to the cluster indicated by the supplied kubeconfig.
func Kubeconfig ¶
func Kubeconfig() string
Kubeconfig returns a path referencing a kubeconfig file suitable for use in tests.
func RegistryUp ¶
func RegistryUp() string
RegistryUp will launch if necessary and return the docker id of a container running a docker registry.
func Sudo ¶
func Sudo()
Sudo is intended for use in a TestMain. It will relaunch the test executable via sudo if it isn't already running with an effective userid of root.
func WithMachineLock ¶
func WithMachineLock(body func())
WithMachineLock executes the supplied body with a guarantee that it is the only code running (via WithMachineLock) on the machine.
func WithNamedMachineLock ¶
func WithNamedMachineLock(name string, body func())
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 ¶
This section is empty.