Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: project report. AZSeparatedToplogy does not provide any az #627

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions internal/reports/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@ func finalizeProjectResourceReport(projectReport *limesresources.ProjectReport,
for _, resReport := range srvReport.Resources {
if len(resReport.PerAZ) >= 2 {
reportInAny := resReport.PerAZ[limes.AvailabilityZoneAny]
// TODO: implement a proper fix and isolate a test case
// AZSeparatedToplogy does not provide the any AZ.
if reportInAny == nil {
continue
}
if (reportInAny.Quota == nil || *reportInAny.Quota == 0) && reportInAny.Usage == 0 {
delete(resReport.PerAZ, limes.AvailabilityZoneAny)
}
Expand Down
Loading