Skip to content

Commit

Permalink
Merge pull request #623 from sapcc/liquid-ironic-fix-topology
Browse files Browse the repository at this point in the history
liquid-ironic: report all AZs required by AZAwareResourceTopology
  • Loading branch information
majewsky authored Dec 11, 2024
2 parents aabca03 + 0a42123 commit 6155bc1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/liquids/ironic/capacity.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (l *Logic) ScanCapacity(ctx context.Context, req liquid.ServiceCapacityRequ
delete(nodesByFlavorName, flavorName)

perAZ := make(map[liquid.AvailabilityZone]*liquid.AZResourceCapacityReport)
for _, az := range req.AllAZs {
perAZ[az] = &liquid.AZResourceCapacityReport{Capacity: 0}
}
for _, node := range matchingNodes {
logg.Debug("Ironic node %q (%s) matches flavor %s", node.Name, node.UUID, flavorName)

Expand All @@ -135,9 +138,9 @@ func (l *Logic) ScanCapacity(ctx context.Context, req liquid.ServiceCapacityRequ
az := azForResourceProviderUUID[node.UUID]
if !slices.Contains(req.AllAZs, az) {
az = liquid.AvailabilityZoneUnknown
}
if perAZ[az] == nil {
perAZ[az] = &liquid.AZResourceCapacityReport{Capacity: 0}
if perAZ[az] == nil {
perAZ[az] = &liquid.AZResourceCapacityReport{Capacity: 0}
}
}
perAZ[az].Capacity++

Expand Down

0 comments on commit 6155bc1

Please sign in to comment.