Skip to content

Commit

Permalink
Merge pull request #3190 from threefoldtech/development_validate_reso…
Browse files Browse the repository at this point in the history
…urces

Fix node resources validation for requesting 0 resources
  • Loading branch information
AhmedHanafy725 authored Jul 31, 2024
2 parents 1b5bca4 + e74a739 commit 0ce0199
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/grid_client/src/primitives/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,9 @@ class Nodes {
async nodeHasResources(nodeId: number, options: FilterOptions): Promise<boolean> {
const resources = await this.getNodeFreeResources(nodeId, "zos");
if (
resources.mru < this._g2b(options.mru) ||
resources.sru < this._g2b(options.sru) ||
resources.hru < this._g2b(options.hru)
(options.mru && options.mru > 0 && resources.mru < this._g2b(options.mru)) ||
(options.sru && options.sru > 0 && resources.sru < this._g2b(options.sru)) ||
(options.hru && options.hru > 0 && resources.hru < this._g2b(options.hru))
) {
return false;
}
Expand Down

0 comments on commit 0ce0199

Please sign in to comment.