Commit 0ecd4716 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

debug

parent f9077078
...@@ -954,6 +954,14 @@ func (s *wafService) getWafServiceMap(ctx context.Context, req *MatcherExpr) (ma ...@@ -954,6 +954,14 @@ func (s *wafService) getWafServiceMap(ctx context.Context, req *MatcherExpr) (ma
return svcMap, nil return svcMap, nil
} }
func groupWafServicesByNamespace(wafServices []model.WafService) map[string][]model.WafService {
svcMap := make(map[string][]model.WafService)
for _, wafService := range wafServices {
svcMap[wafService.Namespace] = append(svcMap[wafService.Namespace], wafService)
}
return svcMap
}
func (s *wafService) createConfigMap(ctx context.Context, req *MatcherExpr, regionCode string, wafSvc []model.WafService) error { func (s *wafService) createConfigMap(ctx context.Context, req *MatcherExpr, regionCode string, wafSvc []model.WafService) error {
client := s.clusterClientManager.GetClient(regionCode) client := s.clusterClientManager.GetClient(regionCode)
if client == nil { if client == nil {
...@@ -1061,6 +1069,7 @@ func (s *wafService) DeleteBlackWhiteList(ctx context.Context, ID uint32) error ...@@ -1061,6 +1069,7 @@ func (s *wafService) DeleteBlackWhiteList(ctx context.Context, ID uint32) error
if err != nil { if err != nil {
return err return err
} }
log.Info().Interface("delete svcMap", svcMap).Msg("delete svcMap")
for regionCode, wafServices := range svcMap { for regionCode, wafServices := range svcMap {
err := s.deleteConfigMap(ctx, ID, regionCode, wafServices) err := s.deleteConfigMap(ctx, ID, regionCode, wafServices)
if err != nil { if err != nil {
...@@ -1111,6 +1120,11 @@ func (s *wafService) GetBlackWhiteLists(ctx context.Context, query *MatchExprQue ...@@ -1111,6 +1120,11 @@ func (s *wafService) GetBlackWhiteLists(ctx context.Context, query *MatchExprQue
exprsResp = append(exprsResp, MatcherExpr{ exprsResp = append(exprsResp, MatcherExpr{
ID: expr.ID, ID: expr.ID,
Name: expr.Name, Name: expr.Name,
Scope: expr.Scope,
Mode: expr.Mode,
Expr: expr.Expr,
Status: int32(expr.Status),
Global: expr.Global,
}) })
} }
return exprsResp, nil return exprsResp, nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment