From 2419eb3aa371f30666fde32fc45e0fa44a9947e0 Mon Sep 17 00:00:00 2001 From: GaoXiaodong <13814823514@163.com> Date: Wed, 9 Feb 2022 19:41:40 +0800 Subject: [PATCH] fix(application): health check use informer get app (#1764) Co-authored-by: xdonggao --- pkg/application/controller/app/app_health.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/application/controller/app/app_health.go b/pkg/application/controller/app/app_health.go index d86bc130d..ea2583b29 100644 --- a/pkg/application/controller/app/app_health.go +++ b/pkg/application/controller/app/app_health.go @@ -24,7 +24,6 @@ import ( "time" "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache" @@ -85,7 +84,7 @@ func (c *Controller) watchAppHealth(ctx context.Context, key string) func() (boo return true, nil } - app, err := c.client.ApplicationV1().Apps(namespace).Get(ctx, name, metav1.GetOptions{}) + app, err := c.lister.Apps(namespace).Get(name) if err != nil && errors.IsNotFound(err) { log.Error("App not found, to exit the health check loop", log.String("name", name))