test

package
v3.1.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const AdmissionWebhookListenPort = 49023

Variables

This section is empty.

Functions

func DeployCRDsForCluster

func DeployCRDsForCluster(ctx context.Context, cluster clusters.Cluster) error

func DeployControllerManagerForCluster

func DeployControllerManagerForCluster(
	ctx context.Context,
	logger logr.Logger,
	cluster clusters.Cluster,
	kongAddon *ktfkong.Addon,
	additionalFlags ...string,
) (func(), error)

DeployControllerManagerForCluster deploys all the base CRDs needed for the controller manager to function, and also runs a copy of the controller manager on a provided test cluster.

Controller managers started this way will run in the background in a goroutine: The caller must use the provided context.Context to stop the controller manager from running when they're done with it.

It returns a context cancellation func which will stop the manager and an error.

func DeployRBACsForCluster

func DeployRBACsForCluster(ctx context.Context, cluster clusters.Cluster) error

func GetAdmissionWebhookListenHost

func GetAdmissionWebhookListenHost() string

GetAdmissionWebhookListenHost returns the host IP address depends on environment where the test is running.

func PrepareClusterForRunningControllerManager added in v3.1.0

func PrepareClusterForRunningControllerManager(
	ctx context.Context,
	cluster clusters.Cluster,
) error

PrepareClusterForRunningControllerManager prepares the provided cluster for running the controller manager. It creates kong's namespace, deploys its RBAC manifests and CRDs.

func RandomName

func RandomName(prefix string) string

RandomName creates a unique name prepended with a predefined prefix. It can be used to populate .Name field of Kubernetes objects.

func SetupLoggers

func SetupLoggers(logLevel string, logFormat string) (logr.Logger, string, error)

SetupLoggers sets up the loggers for the controller manager. The controller manager logs needs to be setup before the 30s timeout passes. Given the cluster deployment takes time, there is a chance that the timeout will pass before the controller manager logs are setup. This function can be used to sets up the loggers for the controller manager before the cluster deployment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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