Do not delete replica service w/o load balancer during sync

This commit is contained in:
Sergey Dudoladov 2018-02-27 17:16:00 +01:00
parent 2ef069ee93
commit b107d781e8
1 changed files with 0 additions and 5 deletions

View File

@ -108,11 +108,6 @@ func (c *Cluster) syncService(role PostgresRole) error {
svc, err := c.KubeClient.Services(c.Namespace).Get(c.serviceName(role), metav1.GetOptions{})
if err == nil {
if role == Replica && !c.Spec.ReplicaLoadBalancer {
if err := c.deleteService(role); err != nil {
return fmt.Errorf("could not delete %s service", role)
}
}
desiredSvc := c.generateService(role, &c.Spec)
match, reason := k8sutil.SameService(svc, desiredSvc)