mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 18:21:53 +02:00
add extra case for using update on svc
This commit is contained in:
@@ -543,7 +543,8 @@ func (c *Cluster) updateService(role PostgresRole, newService *v1.Service) error
|
||||
// patch does not work because of LoadBalancerSourceRanges field (even if set to nil)
|
||||
oldServiceType := c.Services[role].Spec.Type
|
||||
newServiceType := newService.Spec.Type
|
||||
if newServiceType == "ClusterIP" && newServiceType != oldServiceType {
|
||||
if (newServiceType == "ClusterIP" && newServiceType != oldServiceType) ||
|
||||
newServiceType == "LoadBalancer" && len(newService.Annotations) != len(c.Services[role].Annotations) {
|
||||
newService.ResourceVersion = c.Services[role].ResourceVersion
|
||||
newService.Spec.ClusterIP = c.Services[role].Spec.ClusterIP
|
||||
svc, err = c.KubeClient.Services(serviceName.Namespace).Update(context.TODO(), newService, metav1.UpdateOptions{})
|
||||
|
||||
Reference in New Issue
Block a user