fix(drift_narrator): DriftItem.severity → drift_level.value 欄位名稱修正
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
OG T
2026-04-10 10:24:41 +08:00
parent 974f84511b
commit 68e9ef5d26

View File

@@ -130,8 +130,8 @@ class DriftNarratorService:
if item.field_path not in _HPA_ALLOWLIST_PATHS
and not item.is_allowlisted
]
high = sum(1 for i in non_hpa_items if i.severity == "HIGH")
medium = sum(1 for i in non_hpa_items if i.severity == "MEDIUM")
high = sum(1 for i in non_hpa_items if i.drift_level.value == "HIGH")
medium = sum(1 for i in non_hpa_items if i.drift_level.value == "MEDIUM")
return high >= TRIGGER_HIGH_MIN or medium >= TRIGGER_MEDIUM_MIN
async def _generate_narrative(
@@ -179,7 +179,7 @@ class DriftNarratorService:
if item.is_allowlisted or item.field_path in _HPA_ALLOWLIST_PATHS:
continue
lines.append(
f"- [{item.severity}] {item.resource_kind}/{item.resource_name}: "
f"- [{item.drift_level.value}] {item.resource_kind}/{item.resource_name}: "
f"{item.field_path} "
f"(Git: {str(item.git_value)[:30]} → K8s: {str(item.actual_value)[:30]})"
)