Address feedback

Set default numberOfInstances to 2. Add verifications for config. Fix
schema/user typos. Avoid closing an empty connections.
This commit is contained in:
Dmitrii Dolgov
2020-03-19 16:56:04 +01:00
parent 6ae3c3d752
commit f839806616
4 changed files with 32 additions and 10 deletions
+6
View File
@@ -8,6 +8,7 @@ import (
"fmt"
"github.com/zalando/postgres-operator/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util/constants"
)
// CRD describes CustomResourceDefinition specific configuration parameters
@@ -211,5 +212,10 @@ func validate(cfg *Config) (err error) {
if cfg.Workers == 0 {
err = fmt.Errorf("number of workers should be higher than 0")
}
if *cfg.ConnectionPool.NumberOfInstances < constants.ConnPoolMinInstances {
msg := "number of connection pool instances should be higher than %d"
err = fmt.Errorf(msg, constants.ConnPoolMinInstances)
}
return
}