From 0c9f02c34cf7395301148d3185ed5aaf2c51d66b Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Fri, 30 Aug 2024 09:20:38 -0700 Subject: [PATCH] Little optimization Signed-off-by: Tamal Saha --- pkg/graph/reconciler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/graph/reconciler.go b/pkg/graph/reconciler.go index 10ae2444e..4d0fc28c9 100644 --- a/pkg/graph/reconciler.go +++ b/pkg/graph/reconciler.go @@ -93,11 +93,11 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco } func IsDiscoveryError(err error) bool { - if errors.Is(err, &discovery.ErrGroupDiscoveryFailed{}) { + var errRDF *apiutil.ErrResourceDiscoveryFailed + if errors.As(err, &errRDF) { return true } - var errRDF *apiutil.ErrResourceDiscoveryFailed - return errors.As(err, &errRDF) + return errors.Is(err, &discovery.ErrGroupDiscoveryFailed{}) } // SetupWithManager sets up the controller with the Manager.