Skip to content

Commit

Permalink
csi/ui: show Node Only for volumes when controllers aren't required
Browse files Browse the repository at this point in the history
Plugin health for controllers should show "Node Only" in the UI only when both
conditions are true: controllers are not required, and no controllers have
registered themselves (0 expected controllers). This accounts for "monolith"
plugins which show as both controllers and nodes.

This changeset includes the following fixes:

* Update the Plugins tab of the UI so that monolith plugins don't show "Node
  Only" once they've registered.
* Add the missing "Node Only" logic to the Volumes tab of the UI.
  • Loading branch information
tgross committed Nov 20, 2020
1 parent 8a66f11 commit f062c2a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions 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}}
{{#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
15 changes: 12 additions & 3 deletions ui/app/templates/csi/volumes/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,18 @@
<LinkTo @route="csi.volumes.volume" @model={{row.model.plainId}} class="is-primary">{{row.model.name}}</LinkTo>
</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}})
<td data-test-plugin-controller-health>
{{#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

0 comments on commit f062c2a

Please sign in to comment.