Skip to content

Commit

Permalink
Update internal/collector/sync_quota_to_backend.go
Browse files Browse the repository at this point in the history
quota sync: avoid overwrite targetQuota map override from other AZs if the map is already initialized.

Co-authored-by: Stefan Majewsky <[email protected]>
  • Loading branch information
VoigtS and majewsky authored Dec 6, 2024
1 parent 22dfbd7 commit 2bbde92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/collector/sync_quota_to_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ func (c *Collector) performQuotaSync(ctx context.Context, srv db.ProjectService,
return fmt.Errorf("detected invalid AZ: %s for resource: %s with topology: %s has backend_quota: %v", availabilityZone, resourceName, resInfo.Topology, currentAZQuota)
}
azSeparatedResouceIDs = append(azSeparatedResouceIDs, resourceID)
targetAZQuotasInDB[resourceName] = make(map[liquid.AvailabilityZone]liquid.AZResourceQuotaRequest)
if targetAZQuotasInDB[resourceName] == nil {
targetAZQuotasInDB[resourceName] = make(map[liquid.AvailabilityZone]liquid.AZResourceQuotaRequest)
}
targetAZQuotasInDB[resourceName][availabilityZone] = liquid.AZResourceQuotaRequest{Quota: targetAZQuota}
if currentAZQuota == nil || *currentAZQuota < 0 || uint64(*currentAZQuota) != targetAZQuota {
azSeparatedNeedsApply = true
Expand Down

0 comments on commit 2bbde92

Please sign in to comment.