Create/delete replica service regardless of load balancer setup

This commit is contained in:
Sergey Dudoladov 2018-02-27 17:10:49 +01:00
parent cb55749c1b
commit 2ef069ee93
1 changed files with 1 additions and 6 deletions

View File

@ -217,9 +217,7 @@ func (c *Cluster) Create() error {
c.setStatus(spec.ClusterStatusCreating)
for _, role := range []PostgresRole{Master, Replica} {
if role == Replica && !c.Spec.ReplicaLoadBalancer {
continue
}
if c.Endpoints[role] != nil {
return fmt.Errorf("%s endpoint already exists in the cluster", role)
}
@ -589,9 +587,6 @@ func (c *Cluster) Delete() error {
}
for _, role := range []PostgresRole{Master, Replica} {
if role == Replica && !c.Spec.ReplicaLoadBalancer {
continue
}
if err := c.deleteEndpoint(role); err != nil {
return fmt.Errorf("could not delete %s endpoint: %v", role, err)