Add service account name in connection pooler (#2352)
This commit is contained in:
parent
eb0d55ea49
commit
781d17b85c
|
|
@ -406,6 +406,7 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
|
|||
Tolerations: tolerationsSpec,
|
||||
Volumes: poolerVolumes,
|
||||
SecurityContext: &securityContext,
|
||||
ServiceAccountName: c.OpConfig.PodServiceAccountName,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1000,6 +1000,7 @@ func TestPoolerTLS(t *testing.T) {
|
|||
ConnectionPoolerDefaultMemoryRequest: "100Mi",
|
||||
ConnectionPoolerDefaultMemoryLimit: "100Mi",
|
||||
},
|
||||
PodServiceAccountName: "postgres-pod",
|
||||
},
|
||||
}, client, pg, logger, eventRecorder)
|
||||
|
||||
|
|
@ -1028,6 +1029,8 @@ func TestPoolerTLS(t *testing.T) {
|
|||
fsGroup := int64(103)
|
||||
assert.Equal(t, &fsGroup, deploy.Spec.Template.Spec.SecurityContext.FSGroup, "has a default FSGroup assigned")
|
||||
|
||||
assert.Equal(t, "postgres-pod", deploy.Spec.Template.Spec.ServiceAccountName, "need to add a service account name")
|
||||
|
||||
volume := v1.Volume{
|
||||
Name: "my-secret",
|
||||
VolumeSource: v1.VolumeSource{
|
||||
|
|
|
|||
Loading…
Reference in New Issue