Skip to content

Commit e392c0a

Browse files
Remove unecessary clientutil usage in ISIS controller
In this situation is needless to use the `clientutil` as the namespace for the resource is always given explicitly be the `ISIS` resource which contains the `LocalObjectReferences`. Therefore using the client wrapper is not needed.
1 parent 848f491 commit e392c0a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

internal/controller/core/isis_controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"sigs.k8s.io/controller-runtime/pkg/predicate"
2323

2424
"github.com/ironcore-dev/network-operator/api/core/v1alpha1"
25-
"github.com/ironcore-dev/network-operator/internal/clientutil"
2625
"github.com/ironcore-dev/network-operator/internal/conditions"
2726
"github.com/ironcore-dev/network-operator/internal/deviceutil"
2827
"github.com/ironcore-dev/network-operator/internal/provider"
@@ -223,12 +222,10 @@ func (r *ISISReconciler) reconcile(ctx context.Context, s *isisScope) (_ ctrl.Re
223222
}
224223
}
225224

226-
c := clientutil.NewClient(r, s.ISIS.Namespace)
227-
228225
var interfaces []provider.ISISInterface
229226
for _, iface := range s.ISIS.Spec.Interfaces {
230227
res := new(v1alpha1.Interface)
231-
if err := c.Get(ctx, client.ObjectKey{Name: iface.Ref.Name}, res); err != nil {
228+
if err := r.Get(ctx, client.ObjectKey{Name: iface.Ref.Name, Namespace: s.ISIS.Namespace}, res); err != nil {
232229
return ctrl.Result{}, err
233230
}
234231

0 commit comments

Comments
 (0)