Skip to content

Commit

Permalink
refactor:鉴权能力优化调整
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Sep 25, 2024
1 parent 4b5deef commit 41bffc0
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions service/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,13 @@ func (s *Server) findVisibleServices(serviceName, namespaceName string, req *api
visibleServices := make([]*model.Service, 0, 4)
// 数据源都来自Cache,这里拿到的service,已经是源服务
aliasFor := s.getServiceCache(serviceName, namespaceName)
if aliasFor == nil {
aliasFor = &model.Service{
Name: serviceName,
Namespace: namespaceName,
}
ret := s.caches.Service().GetVisibleServicesInOtherNamespace(serviceName, namespaceName)
if len(ret) == 0 {
return nil, nil
}
visibleServices = append(visibleServices, ret...)
} else {
if aliasFor != nil {
visibleServices = append(visibleServices, aliasFor)
}

ret := s.caches.Service().GetVisibleServicesInOtherNamespace(serviceName, namespaceName)
if len(ret) > 0 {
visibleServices = append(visibleServices, ret...)
}
return aliasFor, visibleServices
}

Expand Down

0 comments on commit 41bffc0

Please sign in to comment.