From 74673c11c377641a18413f308d9648104a12d06b Mon Sep 17 00:00:00 2001 From: loganhz Date: Thu, 30 Aug 2018 16:04:41 +0800 Subject: [PATCH] Fix node alert issue https://github.com/rancher/rancher/issues/15301 --- app/components/cluster-dashboard/component.js | 3 ++- lib/shared/addon/utils/constants.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/cluster-dashboard/component.js b/app/components/cluster-dashboard/component.js index 6721ad60c..5c77293c4 100644 --- a/app/components/cluster-dashboard/component.js +++ b/app/components/cluster-dashboard/component.js @@ -1,3 +1,4 @@ +import C from 'ui/utils/constants'; import Component from '@ember/component'; import { set, get, computed, observer } from '@ember/object'; import { alias } from '@ember/object/computed'; @@ -28,7 +29,7 @@ export default Component.extend({ }), inactiveNodes: computed('nodes.@each.state', function() { - return get(this, 'nodes').filter( (n) => get(n, 'state') !== 'active' && get(n, 'state') !== 'cordoned' ); + return get(this, 'nodes').filter( (n) => C.ACTIVEISH_STATES.indexOf(get(n, 'state')) === -1 ); }), unhealthyComponents: computed('componentStatuses.@each.conditions', function() { diff --git a/lib/shared/addon/utils/constants.js b/lib/shared/addon/utils/constants.js index 0ecf5d79c..f7c7d207b 100644 --- a/lib/shared/addon/utils/constants.js +++ b/lib/shared/addon/utils/constants.js @@ -564,6 +564,9 @@ C.ACTIVEISH_STATES = [ 'unhealthy', 'upgrading', 'upgraded', + 'draining', + 'drained', + 'cordoned' ]; C.READY_STATES = [