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
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 {
client := s.clusterClientManager.GetClient(regionCode)
if client == nil {
......@@ -1061,6 +1069,7 @@ func (s *wafService) DeleteBlackWhiteList(ctx context.Context, ID uint32) error
if err != nil {
return err
}
log.Info().Interface("delete svcMap", svcMap).Msg("delete svcMap")
for regionCode, wafServices := range svcMap {
err := s.deleteConfigMap(ctx, ID, regionCode, wafServices)
if err != nil {
......@@ -1109,8 +1118,13 @@ func (s *wafService) GetBlackWhiteLists(ctx context.Context, query *MatchExprQue
exprsResp := []MatcherExpr{}
for _, expr := range exprs {
exprsResp = append(exprsResp, MatcherExpr{
ID: expr.ID,
Name: expr.Name,
ID: expr.ID,
Name: expr.Name,
Scope: expr.Scope,
Mode: expr.Mode,
Expr: expr.Expr,
Status: int32(expr.Status),
Global: expr.Global,
})
}
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