Force ownership on apply to resolve conflicts with manual edits (#309)

If not set the apply will error if a resource has been manually edited.
This changes all apply calls to use force ownership.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Bug Fixes**
* Fixed resource ownership handling across multiple controllers to
ensure proper claim and management of Kubernetes resources during
deployment and reconciliation operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Philip Laine
2026-06-15 21:25:55 +02:00
committed by GitHub
parent 07212d1f72
commit 305bc9ca34
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ func (r *TCPRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
WithNetworkRouterRef(nbv1alpha1ac.CrossNamespaceReference().WithName(netRouter.Name).WithNamespace(netRouter.Namespace)).
WithServiceRef(corev1.LocalObjectReference{Name: svc.Name}),
)
err = r.Client.Apply(ctx, netResourceAC)
err = r.Client.Apply(ctx, netResourceAC, client.ForceOwnership)
if err != nil {
return ctrl.Result{}, err
}