Skip to content

Commit

Permalink
fix(monitor): dynamic clientset is nil (#1679)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoryu committed Nov 26, 2021
1 parent 55cdb50 commit 027e078
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/monitor/util/cache/cache.go
Expand Up @@ -348,6 +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")))
}
content, err := curDynamicClientSet[cluster].Resource(TAppResource).
Namespace(AllNamespaces).List(ctx, metav1.ListOptions{})
if content == nil || (err != nil && !errors.IsNotFound(err)) {
Expand Down

0 comments on commit 027e078

Please sign in to comment.