fix: update service failed when reconcile

Signed-off-by: zhao.laihe <zhao.laihe@neolink.com>
This commit is contained in:
zhao.laihe 2024-02-23 13:11:06 +08:00
parent f04c17f727
commit 0be1a66b39
1 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,8 @@ func CreateOrUpdateService(client clientset.Interface, service *corev1.Service)
}
service.ResourceVersion = older.ResourceVersion
service.Spec.ClusterIP = older.Spec.ClusterIP
service.Spec.ClusterIPs = older.Spec.ClusterIPs
if _, err := client.CoreV1().Services(service.GetNamespace()).Update(context.TODO(), service, metav1.UpdateOptions{}); err != nil {
return fmt.Errorf("unable to update Service: %v", err)
}