Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csi/ui: show Node Only for volumes when controllers aren't required #9416

Merged
merged 4 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ui/app/templates/csi/plugins/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
{{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}}
({{row.model.controllersHealthy}}/{{row.model.controllersExpected}})
{{else}}
<em class="is-faded">Node Only</em>
{{#if (gt row.model.controllersExpected 0)}}
{{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}}
({{row.model.controllersHealthy}}/{{row.model.controllersExpected}})
{{else}}
<em class="is-faded">Node Only</em>
{{/if}}
{{/if}}
</td>
<td data-test-plugin-node-health>
Expand Down
13 changes: 11 additions & 2 deletions ui/app/templates/csi/volumes/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@
</td>
<td data-test-volume-schedulable>{{if row.model.schedulable "Schedulable" "Unschedulable"}}</td>
<td data-test-volume-controller-health>
{{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}}
<em class="is-faded">Node Only</em>
{{/if}}
{{/if}}
</td>
<td data-test-volume-node-health>
{{if (gt row.model.nodesHealthy 0) "Healthy" "Unhealthy"}}
Expand Down
14 changes: 9 additions & 5 deletions ui/tests/acceptance/volumes-list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})`
Expand Down