bump to v1.10.1 (#2410)

* bump to v1.10.1
This commit is contained in:
Felix Kunde
2023-09-07 22:46:26 +02:00
committed by GitHub
parent 781d17b85c
commit 552bd26c0f
22 changed files with 198 additions and 377 deletions
+21
View File
@@ -676,6 +676,7 @@ func TestConnectionPoolerPodSpec(t *testing.T) {
SuperUsername: superUserName,
ReplicationUsername: replicationUserName,
},
PodServiceAccountName: "postgres-pod",
ConnectionPooler: config.ConnectionPooler{
MaxDBConnections: k8sutil.Int32ToPointer(60),
ConnectionPoolerDefaultCPURequest: "100m",
@@ -725,6 +726,15 @@ func TestConnectionPoolerPodSpec(t *testing.T) {
cluster: cluster,
check: noCheck,
},
{
subTest: "pooler uses pod service account",
spec: &acidv1.PostgresSpec{
ConnectionPooler: &acidv1.ConnectionPooler{},
},
expected: nil,
cluster: cluster,
check: testServiceAccount,
},
{
subTest: "no default resources",
spec: &acidv1.PostgresSpec{
@@ -872,6 +882,17 @@ func TestConnectionPoolerDeploymentSpec(t *testing.T) {
}
}
func testServiceAccount(cluster *Cluster, podSpec *v1.PodTemplateSpec, role PostgresRole) error {
poolerServiceAccount := podSpec.Spec.ServiceAccountName
if poolerServiceAccount != cluster.OpConfig.PodServiceAccountName {
return fmt.Errorf("Pooler service account does not match, got %+v, expected %+v",
poolerServiceAccount, cluster.OpConfig.PodServiceAccountName)
}
return nil
}
func testResources(cluster *Cluster, podSpec *v1.PodTemplateSpec, role PostgresRole) error {
cpuReq := podSpec.Spec.Containers[0].Resources.Requests["cpu"]
if cpuReq.String() != cluster.OpConfig.ConnectionPooler.ConnectionPoolerDefaultCPURequest {