Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Stefurishin <[email protected]>
  • Loading branch information
astef committed Nov 22, 2024
1 parent 75bc453 commit 40a36b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion images/agent/src/internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ func makeReconcileDispatcher[T client.Object](
// load object being reconciled
log.Info(fmt.Sprintf("[ReconcileDispatcher] Reconciler starts to reconcile the request %s", req.NamespacedName.String()))

var obj T
t := reflect.TypeFor[T]()
obj := reflect.New(t.Elem()).Interface().(T)

if err := cl.Get(ctx, req.NamespacedName, obj); err != nil {
if errors.IsNotFound(err) {
log.Warning(fmt.Sprintf("[ReconcileDispatcher] seems like the object was deleted as unable to get it, err: %s. Stop to reconcile", err.Error()))
Expand Down

0 comments on commit 40a36b9

Please sign in to comment.