Skip to content

Commit 2dabb65

Browse files
committed
fix: Let the service updater patch the spec instead of rewriting it
This change may help overcoming infinite rewrite loops where STUNner tries to overwrite the LB Service with its own version and then another controller (e.g., MetalLB) doing modifications that we just try to blindly overwrite again.
1 parent 050aabc commit 2dabb65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/updater/client_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (u *Updater) upsertService(svc *corev1.Service, gen int) (ctrlutil.Operatio
131131
Namespace: svc.GetNamespace(),
132132
}}
133133

134-
op, err := ctrlutil.CreateOrUpdate(u.ctx, client, current, func() error {
134+
op, err := ctrlutil.CreateOrPatch(u.ctx, client, current, func() error {
135135
if err := setMetadata(current, svc); err != nil {
136136
return nil
137137
}

0 commit comments

Comments
 (0)