From c6004e5dea822d7c011347b3b11bc063a03b25c8 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Fri, 20 Nov 2020 14:48:47 -0500 Subject: [PATCH] csi/ui: show Node Only for volumes when controllers aren't required 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 might register as both controllers and nodes but not necessarily have `ControllerRequired = true` because they don't implement the Controller RPC endpoints we need (this requirement was added in #7844) 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. --- ui/app/templates/csi/plugins/index.hbs | 5 +++++ ui/app/templates/csi/volumes/index.hbs | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ui/app/templates/csi/plugins/index.hbs b/ui/app/templates/csi/plugins/index.hbs index 7953463bedce..3226027684c6 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}} + {{#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 9290c59565b1..17abf842f14b 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"}}