Add system namespace filtering

- Add configuration to exclude system namespaces by default
- Add UI checkbox to include system namespaces when needed
- Update API endpoints to accept include_system_namespaces parameter
- Update Kubernetes client to apply namespace filtering
- Update ConfigMap and deployment with new environment variables
- Fix Dockerfile to install dependencies globally
- Test functionality with both filtered and unfiltered results
This commit is contained in:
2025-09-25 17:39:33 -03:00
parent 3a6875a80e
commit 071ffefef7
7 changed files with 90 additions and 9 deletions

View File

@@ -175,12 +175,13 @@ async def get_validations_by_namespace(
severity: Optional[str] = None,
page: int = 1,
page_size: int = 20,
include_system_namespaces: bool = False,
k8s_client=Depends(get_k8s_client)
):
"""Listar validações agrupadas por namespace com paginação"""
try:
# Coletar todos os pods
pods = await k8s_client.get_all_pods()
# Coletar todos os pods com filtro de namespaces do sistema
pods = await k8s_client.get_all_pods(include_system_namespaces=include_system_namespaces)
# Validar recursos e agrupar por namespace
namespace_validations = {}