utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentBinary

func AgentBinary(t *testing.T) string

func ApplyCRD

func ApplyCRD(t *testing.T, ctx context.Context, client ctrlruntimeclient.Client, filename string)

func ArtifactsDirectory

func ArtifactsDirectory(t *testing.T) string

func CreateAndWaitForWorkspace

func CreateAndWaitForWorkspace(t *testing.T, ctx context.Context, client ctrlruntimeclient.Client, workspaceName string) logicalcluster.Name

func CreateKcpAgentKubeconfig

func CreateKcpAgentKubeconfig(t *testing.T, path string) string

func GetClient

func GetClient(t *testing.T, kubeconfig string) ctrlruntimeclient.Client

func GetClusterClient

func GetClusterClient(t *testing.T, kubeconfig string) mcclient.ClusterClient

func GetKcpAdminClient

func GetKcpAdminClient(t *testing.T) ctrlruntimeclient.Client

func GetKcpAdminClusterClient

func GetKcpAdminClusterClient(t *testing.T) mcclient.ClusterClient

func GetKcpAdminKubeconfig

func GetKcpAdminKubeconfig(t *testing.T) string

func GrantWorkspaceAccess

func GrantWorkspaceAccess(t *testing.T, ctx context.Context, client ctrlruntimeclient.Client, rbacSubject rbacv1.Subject, extraRules ...rbacv1.PolicyRule)

func KCPMinor

func KCPMinor() int

func RunAgent

func RunAgent(
	ctx context.Context,
	t *testing.T,
	kcpKubeconfig string,
	configWorkspace string,
	labelSelector string,
) context.CancelFunc

func Subject

func Subject() rbacv1.Subject

Subject returns the appropriate RBC subject for the init-agent to use. kcp is started with a custom token file that defines this special user.

func ToUnstructured

func ToUnstructured(t *testing.T, obj any) *unstructured.Unstructured

func WaitForWorkspaceInitialization

func WaitForWorkspaceInitialization(t *testing.T, ctx context.Context, clusterClient mcclient.ClusterClient, parentWorkspace logicalcluster.Path, workspaceName string) *kcptenancyv1alpha1.Workspace

func YAMLToUnstructured

func YAMLToUnstructured(t *testing.T, data string) *unstructured.Unstructured

Types

This section is empty.

Jump to

Keyboard shortcuts

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