Skip to content

Commit

Permalink
feat: 容器场景workload总览支持多ns过滤 --story=121838812 (#4915)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguo367 authored Feb 7, 2025
1 parent 13d895b commit 6c90350
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bkmonitor/packages/monitor_web/k8s/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def perform_request(self, validated_request_data):

# 如果前端传值则添加过滤
if validated_request_data.get("namespace"):
queryset = queryset.filter(namespace=validated_request_data["namespace"])
# 支持多个ns传递, 默认半角逗号连接
ns_list = validated_request_data["namespace"].split(",")
queryset = queryset.filter(namespace__in=ns_list)
if validated_request_data.get("query_string"):
queryset = queryset.filter(name__icontains=validated_request_data["query_string"])

Expand Down

0 comments on commit 6c90350

Please sign in to comment.