Documentation
¶
Overview ¶
Package pgbouncer provides Ginkgo/Gomega assertions over PGBouncer poolers: deployment readiness, pod recreation, endpoint slice routing, and connectivity through the pooler service.
Index ¶
- func AssertDeploymentIsRecreated(env *environment.TestingEnvironment, namespace, poolerSampleFile string)
- func AssertPgBouncerEndpointsContainsPodsIP(env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, ...)
- func AssertPgBouncerHasServiceNameInsideHostParameter(env *environment.TestingEnvironment, serviceName string, ...)
- func AssertPgBouncerPodsAreReady(env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, ...)
- func AssertPgBouncerPoolerDeploymentStrategy(env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, ...)
- func AssertPgBouncerPoolerIsSetUp(env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, ...)
- func AssertPodIsRecreated(env *environment.TestingEnvironment, namespace, poolerSampleFile string)
- func AssertReadWriteConnectionUsingPgBouncerService(env *environment.TestingEnvironment, ...)
- func DeleteTableUsingPgBouncerService(env *environment.TestingEnvironment, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDeploymentIsRecreated ¶
func AssertDeploymentIsRecreated(env *environment.TestingEnvironment, namespace, poolerSampleFile string)
AssertDeploymentIsRecreated deletes the pooler's Deployment and waits for the operator to recreate it with fresh pods.
func AssertPgBouncerEndpointsContainsPodsIP ¶
func AssertPgBouncerEndpointsContainsPodsIP( env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, expectedPodCount int, )
AssertPgBouncerEndpointsContainsPodsIP verifies the pooler service's EndpointSlice points at exactly the expected pooler pods.
func AssertPgBouncerHasServiceNameInsideHostParameter ¶
func AssertPgBouncerHasServiceNameInsideHostParameter( env *environment.TestingEnvironment, serviceName string, podList *corev1.PodList, )
AssertPgBouncerHasServiceNameInsideHostParameter verifies that the pgbouncer.ini inside every pooler pod references the given service name in its host= parameter.
func AssertPgBouncerPodsAreReady ¶
func AssertPgBouncerPodsAreReady( env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, expectedPodCount int, )
AssertPgBouncerPodsAreReady verifies that the pooler's pods are Active and Ready in the expected count.
func AssertPgBouncerPoolerDeploymentStrategy ¶
func AssertPgBouncerPoolerDeploymentStrategy( env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, expectedMaxSurge, expectedMaxUnavailable string, )
AssertPgBouncerPoolerDeploymentStrategy verifies the pooler's Deployment reports the expected rolling-update strategy.
func AssertPgBouncerPoolerIsSetUp ¶
func AssertPgBouncerPoolerIsSetUp( env *environment.TestingEnvironment, namespace, poolerYamlFilePath string, expectedInstanceCount int, )
AssertPgBouncerPoolerIsSetUp creates a pooler from the given YAML file, waits for its Deployment to reach the expected ready replica count, and verifies the underlying pods are ready.
func AssertPodIsRecreated ¶
func AssertPodIsRecreated(env *environment.TestingEnvironment, namespace, poolerSampleFile string)
AssertPodIsRecreated deletes the single pooler pod and verifies a fresh pod (different name) comes up in its place.
func AssertReadWriteConnectionUsingPgBouncerService ¶
func AssertReadWriteConnectionUsingPgBouncerService( env *environment.TestingEnvironment, namespace, clusterName, poolerYamlFilePath string, isPoolerRW bool, connectionParams ...map[string]string, )
AssertReadWriteConnectionUsingPgBouncerService routes a connection through the pooler service and verifies it lands on the appropriate end (primary if isPoolerRW, replica otherwise).
func DeleteTableUsingPgBouncerService ¶
func DeleteTableUsingPgBouncerService( env *environment.TestingEnvironment, namespace, clusterName, poolerYamlFilePath string, pod *corev1.Pod, )
DeleteTableUsingPgBouncerService connects to the pooler service as the application user and runs DROP TABLE table1 via psql inside pod.
Types ¶
This section is empty.