Skip to content

Commit

Permalink
Dashboard: fix nodes calculation (#1255) (#1256)
Browse files Browse the repository at this point in the history
* Dashboard: fix nodes calculation

* unit tests
  • Loading branch information
Gerhut authored Jul 15, 2020
1 parent 612f1ca commit 97268d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ module.exports = async context => {
_increaseBody(['types', type, 'node', 'total'])
if (!healthy) {
_increaseBody(['types', type, 'node', 'unschedulable'])
}
if (_.keys(pods).length > 0) {
} else if (_.keys(pods).length > 0) {
_increaseBody(['types', type, 'node', 'used'])
} else {
_increaseBody(['types', type, 'node', 'available'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ describe('GET /clusters/:clusterId/teams/:teamId', function () {
response.data.should.have.propertyByPath('types', TYPE_NAME, 'node', 'total').equal(2)
response.data.should.have.propertyByPath('types', TYPE_NAME, 'node', 'unschedulable').equal(1)
response.data.should.have.propertyByPath('types', TYPE_NAME, 'node', 'used').equal(1)
response.data.should.have.propertyByPath('types', TYPE_NAME, 'node', 'available').equal(1)
response.data.should.not.have.propertyByPath('types', TYPE_NAME, 'node', 'available')
})
})

0 comments on commit 97268d2

Please sign in to comment.