Skip to content

Commit

Permalink
fix(monitor): cluster dynamic client is nil (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoryu authored Nov 30, 2021
1 parent 6c473aa commit c03474e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/monitor/util/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit c03474e

Please sign in to comment.