Skip to content

Commit

Permalink
fix(inventory): get node on each iteration of the resources count (#1567
Browse files Browse the repository at this point in the history
)

fixes calculation issue when deployment has multiple replicas

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Apr 28, 2022
1 parent 7a3e4a6 commit 38b8225
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion provider/cluster/kube/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ func (inv *inventory) Adjust(reservation ctypes.Reservation) error {
currInventory := inv.dup()

nodes:
for nodeName, nd := range currInventory.nodes {
for nodeName := range currInventory.nodes {
currResources := resources[:0]

for _, res := range resources {
for ; res.Count > 0; res.Count-- {
nd := currInventory.nodes[nodeName]

// first check if there reservation needs persistent storage
// and node handles such class
if !nd.allowsStorageClasses(res.Resources.Storage) {
Expand Down

0 comments on commit 38b8225

Please sign in to comment.