Do not delete replica service w/o load balancer during sync
This commit is contained in:
		
							parent
							
								
									2ef069ee93
								
							
						
					
					
						commit
						b107d781e8
					
				|  | @ -108,11 +108,6 @@ func (c *Cluster) syncService(role PostgresRole) error { | ||||||
| 
 | 
 | ||||||
| 	svc, err := c.KubeClient.Services(c.Namespace).Get(c.serviceName(role), metav1.GetOptions{}) | 	svc, err := c.KubeClient.Services(c.Namespace).Get(c.serviceName(role), metav1.GetOptions{}) | ||||||
| 	if err == nil { | 	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) | 		desiredSvc := c.generateService(role, &c.Spec) | ||||||
| 		match, reason := k8sutil.SameService(svc, desiredSvc) | 		match, reason := k8sutil.SameService(svc, desiredSvc) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue