Documentation
¶
Index ¶
- func ConfigForEnvConfig(t *testing.T, envcfg *rest.Config) manager.Config
- func CreateNamespace(ctx context.Context, t *testing.T, client ctrlclient.Client) corev1.Namespace
- func CreatePod(ctx context.Context, t *testing.T, client ctrlclient.Client, ns string) corev1.Pod
- func NewControllerClient(t *testing.T, cfg *rest.Config) ctrlclient.Client
- func Setup(t *testing.T, scheme *runtime.Scheme) *rest.Config
- func StartAdminAPIServerMock(t *testing.T) *httptest.Server
- func StartReconciler(ctx context.Context, t *testing.T, scheme *runtime.Scheme, cfg *rest.Config, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigForEnvConfig ¶ added in v2.10.0
ConfigForEnvConfig prepares a manager.Config for use in tests It will start a mock Admin API server which will be set in KIC's config and which will be automatically stopped during test cleanup.
func CreateNamespace ¶
CreateNamespace creates namespace using the provided client and returns it.
func NewControllerClient ¶ added in v2.10.2
NewControllerClient returns a new controller-runtime Client for provided rest.Config.
func Setup ¶
Setup sets up the envtest environment which will be stopped on test cleanup using t.Cleanup().
Note: If you want apiserver output on stdout set KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT to true when running tests.
func StartAdminAPIServerMock ¶ added in v2.10.0
StartAdminAPIServerMock starts a mock Kong Admin API server. Server's .Close() method will be called during test's cleanup.
func StartReconciler ¶
func StartReconciler(ctx context.Context, t *testing.T, scheme *runtime.Scheme, cfg *rest.Config, reconciler controllers.Reconciler)
StartReconciler creates a controller manager and starts the provided reconciler as its runnable. It also adds a t.Cleanup which waits for the manager to exit so that the test can be self contained and logs from different tests' managers don't mix up.
Types ¶
This section is empty.