diff --git a/pkg/apis/pxc/v1/pxc_types.go b/pkg/apis/pxc/v1/pxc_types.go index 160e62b39..5f36b75b5 100644 --- a/pkg/apis/pxc/v1/pxc_types.go +++ b/pkg/apis/pxc/v1/pxc_types.go @@ -550,7 +550,7 @@ type HAProxySpec struct { // Deprecated: Use ExposeReplica.Enabled instead ReplicasServiceEnabled *bool `json:"replicasServiceEnabled,omitempty"` - // Deprecated: Use ExposeReplica.LoadBalancerSourceRanges instead + // Deprecated: Use ExposeReplicas.LoadBalancerSourceRanges instead ReplicasLoadBalancerSourceRanges []string `json:"replicasLoadBalancerSourceRanges,omitempty"` // Deprecated: Use ExposeReplica.LoadBalancerIP instead ReplicasLoadBalancerIP string `json:"replicasLoadBalancerIP,omitempty"` diff --git a/pkg/pxc/service.go b/pkg/pxc/service.go index 0be5cced2..2b7b599db 100644 --- a/pkg/pxc/service.go +++ b/pkg/pxc/service.go @@ -432,7 +432,7 @@ func NewServiceHAProxyReplicas(cr *api.PerconaXtraDBCluster) *corev1.Service { if cr.CompareVersionWith("1.14.0") >= 0 { if cr.Spec.HAProxy.ExposeReplicas.ServiceExpose.LoadBalancerSourceRanges != nil { loadBalancerSourceRanges = cr.Spec.HAProxy.ExposeReplicas.ServiceExpose.LoadBalancerSourceRanges - } else { + } else if cr.Spec.HAProxy.ExposeReplicas.ServiceExpose.LoadBalancerSourceRanges == nil && cr.Spec.HAProxy.ExposeReplicas.Type == corev1.ServiceTypeLoadBalancer { loadBalancerSourceRanges = cr.Spec.HAProxy.ExposePrimary.LoadBalancerSourceRanges } loadBalancerIP = cr.Spec.HAProxy.ExposeReplicas.ServiceExpose.LoadBalancerIP