Rename replicas to avoid potential confusion about terminology

This commit is contained in:
Dmitrii Dolgov
2020-02-13 16:34:02 +01:00
parent e2664843ba
commit e11f787664
18 changed files with 30 additions and 30 deletions
@@ -327,7 +327,7 @@ spec:
connection_pool_user: connection_pool_user:
type: string type: string
#default: "pooler" #default: "pooler"
connection_pool_replicas: connection_pool_number_of_instances:
type: integer type: integer
#default: 1 #default: 1
connection_pool_image: connection_pool_image:
@@ -251,7 +251,7 @@ spec:
type: string type: string
user: user:
type: string type: string
replicas: number_of_instances:
type: integer type: integer
dockerImage: dockerImage:
type: string type: string
+1 -1
View File
@@ -263,7 +263,7 @@ configScalyr:
configConnectionPool: configConnectionPool:
# number of pooler instances # number of pooler instances
connection_pool_replicas: 1 connection_pool_number_of_instances: 1
# db schema to install lookup function into # db schema to install lookup function into
connection_pool_schema: "pooler" connection_pool_schema: "pooler"
# db user for pooler to use # db user for pooler to use
+1 -1
View File
@@ -240,7 +240,7 @@ configTeamsApi:
# configure connection pooler deployment created by the operator # configure connection pooler deployment created by the operator
configConnectionPool: configConnectionPool:
# number of pooler instances # number of pooler instances
connection_pool_replicas: 1 connection_pool_number_of_instances: 1
# db schema to install lookup function into # db schema to install lookup function into
connection_pool_schema: "pooler" connection_pool_schema: "pooler"
# db user for pooler to use # db user for pooler to use
+1 -1
View File
@@ -372,7 +372,7 @@ configuration for connection pool. If this section is not empty, a connection
pool will be created for a database even if `enableConnectionPool` is not pool will be created for a database even if `enableConnectionPool` is not
present. present.
* **replicas** * **number_of_instances**
How many instances of connection pool to create. How many instances of connection pool to create.
* **mode** * **mode**
+1 -1
View File
@@ -600,7 +600,7 @@ default configuration for connection pool, if a postgres manifest requests it
but do not specify some of the parameters. All of them are optional with the but do not specify some of the parameters. All of them are optional with the
operator being able to provide some reasonable defaults. operator being able to provide some reasonable defaults.
* **connection_pool_replicas** * **connection_pool_number_of_instances**
How many instances of connection pool to create. How many instances of connection pool to create.
* **connection_pool_schema** * **connection_pool_schema**
+1 -1
View File
@@ -478,7 +478,7 @@ To configure a new connection pool, specify:
spec: spec:
connectionPool: connectionPool:
# how many instances of connection pool to create # how many instances of connection pool to create
replicas: 1 number_of_instances: 1
# in which mode to run, session or transaction # in which mode to run, session or transaction
mode: "transaction" mode: "transaction"
+1 -1
View File
@@ -16,7 +16,7 @@ data:
# connection_pool_default_memory_limit: 100m # connection_pool_default_memory_limit: 100m
# connection_pool_default_memory_request: "100Mi" # connection_pool_default_memory_request: "100Mi"
# connection_pool_image: "" # connection_pool_image: ""
# connection_pool_replicas: 1 # connection_pool_number_of_instances: 1
# connection_pool_mode: "transaction" # connection_pool_mode: "transaction"
# connection_pool_schema: "pooler" # connection_pool_schema: "pooler"
# connection_pool_user: "pooler" # connection_pool_user: "pooler"
+1 -1
View File
@@ -303,7 +303,7 @@ spec:
connection_pool_user: connection_pool_user:
type: string type: string
#default: "pooler" #default: "pooler"
connection_pool_replicas: connection_pool_number_of_instances:
type: integer type: integer
#default: 1 #default: 1
connection_pool_image: connection_pool_image:
@@ -127,7 +127,7 @@ configuration:
connection_pool_default_memory_limit: 100m connection_pool_default_memory_limit: 100m
connection_pool_default_memory_request: "100Mi" connection_pool_default_memory_request: "100Mi"
connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer:master-3" connection_pool_image: "registry.opensource.zalan.do/acid/pgbouncer:master-3"
connection_pool_replicas: 1 connection_pool_number_of_instances: 1
connection_pool_mode: "transaction" connection_pool_mode: "transaction"
# connection_pool_schema: "pooler" # connection_pool_schema: "pooler"
# connection_pool_user: "pooler" # connection_pool_user: "pooler"
+1 -1
View File
@@ -215,7 +215,7 @@ spec:
type: string type: string
user: user:
type: string type: string
replicas: number_of_instances:
type: integer type: integer
dockerImage: dockerImage:
type: string type: string
@@ -154,7 +154,7 @@ type ScalyrConfiguration struct {
// Defines default configuration for connection pool // Defines default configuration for connection pool
type ConnectionPoolConfiguration struct { type ConnectionPoolConfiguration struct {
Replicas *int32 `json:"connection_pool_replicas,omitempty"` NumberOfInstances *int32 `json:"connection_pool_number_of_instances,omitempty"`
Schema string `json:"connection_pool_schema,omitempty"` Schema string `json:"connection_pool_schema,omitempty"`
User string `json:"connection_pool_user,omitempty"` User string `json:"connection_pool_user,omitempty"`
Image string `json:"connection_pool_image,omitempty"` Image string `json:"connection_pool_image,omitempty"`
+5 -5
View File
@@ -169,11 +169,11 @@ type PostgresStatus struct {
// makes sense to expose. E.g. pool size (min/max boundaries), max client // makes sense to expose. E.g. pool size (min/max boundaries), max client
// connections etc. // connections etc.
type ConnectionPool struct { type ConnectionPool struct {
Replicas *int32 `json:"replicas,omitempty"` NumberOfInstances *int32 `json:"number_of_instances,omitempty"`
Schema string `json:"schema,omitempty"` Schema string `json:"schema,omitempty"`
User string `json:"user,omitempty"` User string `json:"user,omitempty"`
Mode string `json:"mode,omitempty"` Mode string `json:"mode,omitempty"`
DockerImage string `json:"dockerImage,omitempty"` DockerImage string `json:"dockerImage,omitempty"`
Resources `json:"resources,omitempty"` Resources `json:"resources,omitempty"`
} }
@@ -71,8 +71,8 @@ func (in *CloneDescription) DeepCopy() *CloneDescription {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConnectionPool) DeepCopyInto(out *ConnectionPool) { func (in *ConnectionPool) DeepCopyInto(out *ConnectionPool) {
*out = *in *out = *in
if in.Replicas != nil { if in.NumberOfInstances != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.NumberOfInstances, &out.NumberOfInstances
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
@@ -93,8 +93,8 @@ func (in *ConnectionPool) DeepCopy() *ConnectionPool {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConnectionPoolConfiguration) DeepCopyInto(out *ConnectionPoolConfiguration) { func (in *ConnectionPoolConfiguration) DeepCopyInto(out *ConnectionPoolConfiguration) {
*out = *in *out = *in
if in.Replicas != nil { if in.NumberOfInstances != nil {
in, out := &in.Replicas, &out.Replicas in, out := &in.NumberOfInstances, &out.NumberOfInstances
*out = new(int32) *out = new(int32)
**out = **in **out = **in
} }
+2 -2
View File
@@ -1861,9 +1861,9 @@ func (c *Cluster) generateConnPoolDeployment(spec *acidv1.PostgresSpec) (
*appsv1.Deployment, error) { *appsv1.Deployment, error) {
podTemplate, err := c.generateConnPoolPodTemplate(spec) podTemplate, err := c.generateConnPoolPodTemplate(spec)
numberOfInstances := spec.ConnectionPool.Replicas numberOfInstances := spec.ConnectionPool.NumberOfInstances
if numberOfInstances == nil { if numberOfInstances == nil {
numberOfInstances = c.OpConfig.ConnectionPool.Replicas numberOfInstances = c.OpConfig.ConnectionPool.NumberOfInstances
} }
if err != nil { if err != nil {
+2 -2
View File
@@ -99,14 +99,14 @@ func TestConnPoolSynchronization(t *testing.T) {
oldSpec: &acidv1.Postgresql{ oldSpec: &acidv1.Postgresql{
Spec: acidv1.PostgresSpec{ Spec: acidv1.PostgresSpec{
ConnectionPool: &acidv1.ConnectionPool{ ConnectionPool: &acidv1.ConnectionPool{
Replicas: int32ToPointer(1), NumberOfInstances: int32ToPointer(1),
}, },
}, },
}, },
newSpec: &acidv1.Postgresql{ newSpec: &acidv1.Postgresql{
Spec: acidv1.PostgresSpec{ Spec: acidv1.PostgresSpec{
ConnectionPool: &acidv1.ConnectionPool{ ConnectionPool: &acidv1.ConnectionPool{
Replicas: int32ToPointer(2), NumberOfInstances: int32ToPointer(2),
}, },
}, },
}, },
+4 -4
View File
@@ -146,13 +146,13 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur
// Connection pool. Looks like we can't use defaulting in CRD before 1.17, // Connection pool. Looks like we can't use defaulting in CRD before 1.17,
// so ensure default values here. // so ensure default values here.
result.ConnectionPool.Replicas = fromCRD.ConnectionPool.Replicas result.ConnectionPool.NumberOfInstances = fromCRD.ConnectionPool.NumberOfInstances
if result.ConnectionPool.Replicas == nil || if result.ConnectionPool.NumberOfInstances == nil ||
*result.ConnectionPool.Replicas < 1 { *result.ConnectionPool.NumberOfInstances < 1 {
var value int32 var value int32
value = 1 value = 1
result.ConnectionPool.Replicas = &value result.ConnectionPool.NumberOfInstances = &value
} }
result.ConnectionPool.Schema = util.Coalesce( result.ConnectionPool.Schema = util.Coalesce(
+1 -1
View File
@@ -85,7 +85,7 @@ type LogicalBackup struct {
// Operator options for connection pooler // Operator options for connection pooler
type ConnectionPool struct { type ConnectionPool struct {
Replicas *int32 `name:"connection_pool_replicas" default:"1"` NumberOfInstances *int32 `name:"connection_pool_number_of_instances" default:"1"`
Schema string `name:"connection_pool_schema" default:"pooler"` Schema string `name:"connection_pool_schema" default:"pooler"`
User string `name:"connection_pool_user" default:"pooler"` User string `name:"connection_pool_user" default:"pooler"`
Image string `name:"connection_pool_image" default:"pgbouncer:1.0"` Image string `name:"connection_pool_image" default:"pgbouncer:1.0"`