utils

package
v0.0.0-...-2e4dc9e Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWorkspaceManager

func BuildWorkspaceManager(mainPath string) string

Build the workspace-manager binary. mainPath is the path to the main module.

func CreateKubeconfigFileForRestConfig

func CreateKubeconfigFileForRestConfig(restConfig rest.Config) string

Create a Kubeconfig from the given rest config.

func CreateLogFile

func CreateLogFile(dir string) *os.File

Create a file in a temporary directory for storing workspace-manager output. The path to the log file will be printed so it can be seen in the output. of the test suite. dir is a directory for storing the file with the workspace-manager output. If empty the default temporary directory will be used.

func CreateWorkspaceManagerServer

func CreateWorkspaceManagerServer(mainPath string, env []string, logsDir string) (*exec.Cmd, context.CancelFunc)

Build and start workspace-manager mainPath is the path to the main module env is an array for specifying environment variables to be declared in the workspace-manager process. logsDir is a directory for storing the file with the workspace-manager output. If empty the default temporary directory will be used.

func StartTestEnv

func StartTestEnv(scheme *runtime.Scheme, testEnv *envtest.Environment) client.Client

Start the envtest environment

func StartWorkspaceManagerServer

func StartWorkspaceManagerServer(binPath string, env []string, logFile *os.File) (*exec.Cmd, context.CancelFunc)

Start workspace manager in the background. Return its backing Cmd and a function that can be used to kill its process. binPath is the path to the workspace-manager binary env is an array for specifying environment variables to be declared in the workspace-manager process. logFile is a file that will be used for storing workspace-manager stdout and stderr.

func StopEnvTest

func StopEnvTest(envTest *envtest.Environment)

Stop the envtest environment

func StopWorkspaceManagerServer

func StopWorkspaceManagerServer(cmd *exec.Cmd, serverCancelFunc context.CancelFunc)

Stop the workspace-manager process and wait for it to be stopped

func WaitForWorkspaceManagerServerToServe

func WaitForWorkspaceManagerServerToServe()

Wait for workspace-manager to start serving http requests

Types

This section is empty.

Jump to

Keyboard shortcuts

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