From 056af6c0f0a56b5ded71d7d643bf01a0592579a3 Mon Sep 17 00:00:00 2001 From: VoigtS Date: Fri, 13 Dec 2024 15:56:27 +0100 Subject: [PATCH] also fix cluster report temporarely --- internal/reports/cluster.go | 5 +++++ internal/reports/project.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/reports/cluster.go b/internal/reports/cluster.go index 862f99ba..5c73e260 100644 --- a/internal/reports/cluster.go +++ b/internal/reports/cluster.go @@ -372,6 +372,11 @@ func GetClusterResources(cluster *core.Cluster, now time.Time, dbi db.Interface, // zero and there are other AZs if len(resource.PerAZ) >= 2 { capaInAny := resource.PerAZ[limes.AvailabilityZoneAny] + // TODO: implement a proper fix and create a test case + // AZSeparateToplogy does not contain ANY AZ. + if capaInAny == nil { + continue + } if capaInAny.Capacity == 0 && capaInAny.Usage == nil && capaInAny.ProjectsUsage == 0 { delete(resource.PerAZ, limes.AvailabilityZoneAny) } diff --git a/internal/reports/project.go b/internal/reports/project.go index 5d128209..55662d1a 100644 --- a/internal/reports/project.go +++ b/internal/reports/project.go @@ -404,7 +404,7 @@ func finalizeProjectResourceReport(projectReport *limesresources.ProjectReport, // TODO: implement a proper fix and isolate a test case // AZSeparatedToplogy does not provide the any AZ. if reportInAny == nil { - return nil + continue } if (reportInAny.Quota == nil || *reportInAny.Quota == 0) && reportInAny.Usage == 0 { delete(resReport.PerAZ, limes.AvailabilityZoneAny)