diff --git a/pkg/monitor/util/cache/cache.go b/pkg/monitor/util/cache/cache.go index c525a275d..7755bc59b 100644 --- a/pkg/monitor/util/cache/cache.go +++ b/pkg/monitor/util/cache/cache.go @@ -348,8 +348,9 @@ func NewCacher(platformClient platformversionedclient.PlatformV1Interface, func (c *cacher) getTApps(ctx context.Context, curDynamicClientSet util.DynamicClientSet, cluster string) int { count := 0 - if curDynamicClientSet == nil { - log.Warn("Query TApps failed", log.Any("cluster", cluster), log.Err(fmt.Errorf("DynamicClientSet is nil"))) + if curDynamicClientSet[cluster] == nil { + log.Info("Query TApps failed", log.Any("cluster", cluster), log.Err(fmt.Errorf("DynamicClientSet is nil"))) + return 0 } content, err := curDynamicClientSet[cluster].Resource(TAppResource). Namespace(AllNamespaces).List(ctx, metav1.ListOptions{})