diff --git a/ui/app/templates/csi/plugins/index.hbs b/ui/app/templates/csi/plugins/index.hbs index 7953463bedc..5e3f7c6524f 100644 --- a/ui/app/templates/csi/plugins/index.hbs +++ b/ui/app/templates/csi/plugins/index.hbs @@ -46,7 +46,12 @@ {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}} ({{row.model.controllersHealthy}}/{{row.model.controllersExpected}}) {{else}} - Node Only + {{#if (gt row.model.controllersExpected 0)}} + {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}} + ({{row.model.controllersHealthy}}/{{row.model.controllersExpected}}) + {{else}} + Node Only + {{/if}} {{/if}} diff --git a/ui/app/templates/csi/volumes/index.hbs b/ui/app/templates/csi/volumes/index.hbs index 9290c59565b..deb649a5f9a 100644 --- a/ui/app/templates/csi/volumes/index.hbs +++ b/ui/app/templates/csi/volumes/index.hbs @@ -45,8 +45,17 @@ {{if row.model.schedulable "Schedulable" "Unschedulable"}} - {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}} - ({{row.model.controllersHealthy}}/{{row.model.controllersExpected}}) + {{#if row.model.controllerRequired}} + {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}} + ({{row.model.controllersHealthy}}/{{row.model.controllersExpected}}) + {{else}} + {{#if (gt row.model.controllersExpected 0)}} + {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}} + ({{row.model.controllersHealthy}}/{{row.model.controllersExpected}}) + {{else}} + Node Only + {{/if}} + {{/if}} {{if (gt row.model.nodesHealthy 0) "Healthy" "Unhealthy"}} diff --git a/ui/tests/acceptance/volumes-list-test.js b/ui/tests/acceptance/volumes-list-test.js index 7adf7736474..e6e18586f2e 100644 --- a/ui/tests/acceptance/volumes-list-test.js +++ b/ui/tests/acceptance/volumes-list-test.js @@ -69,15 +69,19 @@ module('Acceptance | volumes list', function(hooks) { const volumeRow = VolumesList.volumes.objectAt(0); - const controllerHealthStr = volume.controllersHealthy > 0 ? 'Healthy' : 'Unhealthy'; + let controllerHealthStr = 'Node Only'; + if (volume.controllerRequired || volume.controllersExpected > 0) { + const healthy = volume.controllersHealthy; + const expected = volume.controllersExpected; + const isHealthy = healthy > 0; + controllerHealthStr = `${isHealthy ? 'Healthy' : 'Unhealthy'} (${healthy}/${expected})`; + } + const nodeHealthStr = volume.nodesHealthy > 0 ? 'Healthy' : 'Unhealthy'; assert.equal(volumeRow.name, volume.id); assert.equal(volumeRow.schedulable, volume.schedulable ? 'Schedulable' : 'Unschedulable'); - assert.equal( - volumeRow.controllerHealth, - `${controllerHealthStr} (${volume.controllersHealthy}/${volume.controllersExpected})` - ); + assert.equal(volumeRow.controllerHealth, controllerHealthStr); assert.equal( volumeRow.nodeHealth, `${nodeHealthStr} (${volume.nodesHealthy}/${volume.nodesExpected})`