Resolve review comments
This commit is contained in:
parent
770fc1e612
commit
46ff4bb738
|
|
@ -189,13 +189,18 @@ func (c *Cluster) createConnectionPooler(lookup InstallFunction) (*ConnectionPoo
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c.ConnectionPooler = &ConnectionPoolerObjects{
|
||||
ReplDeployment: repldeployment,
|
||||
ReplService: replService,
|
||||
|
||||
if c.needMasterConnectionPooler() {
|
||||
c.ConnectionPooler.ReplDeployment = repldeployment
|
||||
c.ConnectionPooler.ReplService = replService
|
||||
} else {
|
||||
c.ConnectionPooler = &ConnectionPoolerObjects{
|
||||
ReplDeployment: repldeployment,
|
||||
ReplService: replService,
|
||||
}
|
||||
}
|
||||
c.logger.Debugf("created new connection pooler for replica %q, uid: %q",
|
||||
util.NameFromMeta(repldeployment.ObjectMeta), repldeployment.UID)
|
||||
|
||||
}
|
||||
|
||||
return c.ConnectionPooler, nil
|
||||
|
|
@ -214,7 +219,7 @@ func (c *Cluster) deleteConnectionPooler(role PostgresRole) (err error) {
|
|||
|
||||
// Clean up the deployment object. If deployment resource we've remembered
|
||||
// is somehow empty, try to delete based on what would we generate
|
||||
deploymentName := c.connectionPoolerName(role)
|
||||
var deploymentName string
|
||||
var deployment *appsv1.Deployment
|
||||
|
||||
if role == Master {
|
||||
|
|
|
|||
|
|
@ -1005,10 +1005,8 @@ func (c *Cluster) syncConnectionPoolerWorker(oldSpec, newSpec *acidv1.Postgresql
|
|||
specSync, specReason := c.needSyncConnectionPoolerSpecs(oldConnectionPooler, newConnectionPooler)
|
||||
defaultsSync, defaultsReason := c.needSyncConnectionPoolerDefaults(newConnectionPooler, deployment)
|
||||
reason := append(specReason, defaultsReason...)
|
||||
c.logger.Warningf("role and reason %v, %v", role, reason)
|
||||
|
||||
if specSync || defaultsSync {
|
||||
c.logger.Infof("Update connection pooler deployment %s, reason: %+v",
|
||||
c.connectionPoolerName(role), reason)
|
||||
|
||||
newDeploymentSpec, err := c.generateConnectionPoolerDeployment(&newSpec.Spec, role)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue