Documentation ¶
Index ¶
- Constants
- func DeployCRDsForCluster(ctx context.Context, cluster clusters.Cluster) error
- func DeployControllerManagerForCluster(ctx context.Context, logger logr.Logger, cluster clusters.Cluster, ...) (func(), error)
- func DeployRBACsForCluster(ctx context.Context, cluster clusters.Cluster) error
- func GetAdmissionWebhookListenHost() string
- func PrepareClusterForRunningControllerManager(ctx context.Context, cluster clusters.Cluster) error
- func RandomName(prefix string) string
- func SetupLoggers(logLevel string, logFormat string) (logr.Logger, string, error)
Constants ¶
const AdmissionWebhookListenPort = 49023
Variables ¶
This section is empty.
Functions ¶
func DeployCRDsForCluster ¶
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 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 ¶
RandomName creates a unique name prepended with a predefined prefix. It can be used to populate .Name field of Kubernetes objects.
func SetupLoggers ¶
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.