Skip to content

Commit 9e6165c

Browse files
Add client.ForceOwnership to SSA status patches
Follows idiomatic controller pattern for exclusive status ownership and defends against edge-case SSA field conflicts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 10e5d05 commit 9e6165c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

operator/internal/controller/auto/update_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func (rs *reconcileSession) updateStatus(ctx context.Context, obj *autov1alpha1.
365365

366366
oldRevision := obj.ResourceVersion
367367
err := rs.client.Status().Patch(ctx, obj, &applyConfiguration{config: patch},
368-
client.FieldOwner(UpdateStatusFieldManager))
368+
client.FieldOwner(UpdateStatusFieldManager), client.ForceOwnership)
369369
if err != nil {
370370
return fmt.Errorf("updating status: %w", err)
371371
}

operator/internal/controller/auto/workspace_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (r *WorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
125125
WithConditions(applyConditions...)
126126
patch := autoapply.Workspace(w.Name, w.Namespace).WithStatus(statusApply)
127127
err := r.Status().Patch(ctx, w, &applyConfiguration{config: patch},
128-
client.FieldOwner(WorkspaceStatusFieldManager))
128+
client.FieldOwner(WorkspaceStatusFieldManager), client.ForceOwnership)
129129
if err != nil {
130130
l.Error(err, "updating status")
131131
} else {

0 commit comments

Comments
 (0)