Do not delete an endpoint for the replica service w/o load balancer during sync
This commit is contained in:
		
							parent
							
								
									b107d781e8
								
							
						
					
					
						commit
						28fed26845
					
				|  | @ -160,11 +160,6 @@ func (c *Cluster) syncEndpoint(role PostgresRole) error { | ||||||
| 
 | 
 | ||||||
| 	ep, err := c.KubeClient.Endpoints(c.Namespace).Get(c.endpointName(role), metav1.GetOptions{}) | 	ep, err := c.KubeClient.Endpoints(c.Namespace).Get(c.endpointName(role), metav1.GetOptions{}) | ||||||
| 	if err == nil { | 	if err == nil { | ||||||
| 		if role == Replica && !c.Spec.ReplicaLoadBalancer { |  | ||||||
| 			if err := c.deleteEndpoint(role); err != nil { |  | ||||||
| 				return fmt.Errorf("could not delete %s endpoint", role) |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 
 | 
 | ||||||
| 		c.Endpoints[role] = ep | 		c.Endpoints[role] = ep | ||||||
| 		return nil | 		return nil | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue