mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-07 22:30:18 +02:00
Rename replicas to avoid potential confusion about terminology
This commit is contained in:
@@ -154,7 +154,7 @@ type ScalyrConfiguration struct {
|
||||
|
||||
// Defines default configuration for connection pool
|
||||
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"`
|
||||
User string `json:"connection_pool_user,omitempty"`
|
||||
Image string `json:"connection_pool_image,omitempty"`
|
||||
|
||||
@@ -169,11 +169,11 @@ type PostgresStatus struct {
|
||||
// makes sense to expose. E.g. pool size (min/max boundaries), max client
|
||||
// connections etc.
|
||||
type ConnectionPool struct {
|
||||
Replicas *int32 `json:"replicas,omitempty"`
|
||||
Schema string `json:"schema,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
DockerImage string `json:"dockerImage,omitempty"`
|
||||
NumberOfInstances *int32 `json:"number_of_instances,omitempty"`
|
||||
Schema string `json:"schema,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
DockerImage string `json:"dockerImage,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.
|
||||
func (in *ConnectionPool) DeepCopyInto(out *ConnectionPool) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
if in.NumberOfInstances != nil {
|
||||
in, out := &in.NumberOfInstances, &out.NumberOfInstances
|
||||
*out = new(int32)
|
||||
**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.
|
||||
func (in *ConnectionPoolConfiguration) DeepCopyInto(out *ConnectionPoolConfiguration) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
if in.NumberOfInstances != nil {
|
||||
in, out := &in.NumberOfInstances, &out.NumberOfInstances
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
|
||||
@@ -1861,9 +1861,9 @@ func (c *Cluster) generateConnPoolDeployment(spec *acidv1.PostgresSpec) (
|
||||
*appsv1.Deployment, error) {
|
||||
|
||||
podTemplate, err := c.generateConnPoolPodTemplate(spec)
|
||||
numberOfInstances := spec.ConnectionPool.Replicas
|
||||
numberOfInstances := spec.ConnectionPool.NumberOfInstances
|
||||
if numberOfInstances == nil {
|
||||
numberOfInstances = c.OpConfig.ConnectionPool.Replicas
|
||||
numberOfInstances = c.OpConfig.ConnectionPool.NumberOfInstances
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -99,14 +99,14 @@ func TestConnPoolSynchronization(t *testing.T) {
|
||||
oldSpec: &acidv1.Postgresql{
|
||||
Spec: acidv1.PostgresSpec{
|
||||
ConnectionPool: &acidv1.ConnectionPool{
|
||||
Replicas: int32ToPointer(1),
|
||||
NumberOfInstances: int32ToPointer(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
newSpec: &acidv1.Postgresql{
|
||||
Spec: acidv1.PostgresSpec{
|
||||
ConnectionPool: &acidv1.ConnectionPool{
|
||||
Replicas: int32ToPointer(2),
|
||||
NumberOfInstances: int32ToPointer(2),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
// so ensure default values here.
|
||||
result.ConnectionPool.Replicas = fromCRD.ConnectionPool.Replicas
|
||||
if result.ConnectionPool.Replicas == nil ||
|
||||
*result.ConnectionPool.Replicas < 1 {
|
||||
result.ConnectionPool.NumberOfInstances = fromCRD.ConnectionPool.NumberOfInstances
|
||||
if result.ConnectionPool.NumberOfInstances == nil ||
|
||||
*result.ConnectionPool.NumberOfInstances < 1 {
|
||||
var value int32
|
||||
|
||||
value = 1
|
||||
result.ConnectionPool.Replicas = &value
|
||||
result.ConnectionPool.NumberOfInstances = &value
|
||||
}
|
||||
|
||||
result.ConnectionPool.Schema = util.Coalesce(
|
||||
|
||||
@@ -85,7 +85,7 @@ type LogicalBackup struct {
|
||||
|
||||
// Operator options for connection pooler
|
||||
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"`
|
||||
User string `name:"connection_pool_user" default:"pooler"`
|
||||
Image string `name:"connection_pool_image" default:"pgbouncer:1.0"`
|
||||
|
||||
Reference in New Issue
Block a user