Skip to content

Commit

Permalink
also fix cluster report temporarely
Browse files Browse the repository at this point in the history
  • Loading branch information
VoigtS committed Dec 13, 2024
1 parent cecf72d commit 056af6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/reports/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/reports/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 056af6c

Please sign in to comment.