From c3d1cb83420cad5134153bce472d462725a28ffc Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Wed, 10 Jun 2015 12:57:47 -0700 Subject: [PATCH] Support null healthState (rancherio/rancher#1134) --- app/container/controller.js | 11 ++++++----- app/container/model.js | 2 +- app/service/model.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/container/controller.js b/app/container/controller.js index a224ae1a5..11329d273 100644 --- a/app/container/controller.js +++ b/app/container/controller.js @@ -134,11 +134,12 @@ var ContainerController = Cattle.TransitioningResourceController.extend({ ContainerController.reopenClass({ stateMap: { - 'running': {icon: 'ss-record', color: 'text-success'}, - 'stopped': {icon: 'fa fa-circle',color: 'text-danger'}, - 'removed': {icon: 'ss-trash', color: 'text-danger'}, - 'purged': {icon: 'ss-tornado', color: 'text-danger'}, - 'unhealthy': {icon: 'ss-notifications', color: 'text-danger'}, + 'running': {icon: 'ss-record', color: 'text-success'}, + 'stopped': {icon: 'fa fa-circle', color: 'text-danger'}, + 'removed': {icon: 'ss-trash', color: 'text-danger'}, + 'purged': {icon: 'ss-tornado', color: 'text-danger'}, + 'unhealthy': {icon: 'ss-notifications', color: 'text-danger'}, + 'initializing': {icon: 'ss-notifications', color: 'text-warning'}, }, }); diff --git a/app/container/model.js b/app/container/model.js index a3acd84be..2418715ab 100644 --- a/app/container/model.js +++ b/app/container/model.js @@ -31,7 +31,7 @@ var Container = Cattle.TransitioningResource.extend({ if ( ['running','active','updating-active'].indexOf(resource) >= 0 ) { - if ( health === 'healthy' ) + if ( health === null || health === 'healthy' ) { return resource; } diff --git a/app/service/model.js b/app/service/model.js index 106b67ad9..77646e10b 100644 --- a/app/service/model.js +++ b/app/service/model.js @@ -19,7 +19,7 @@ var Service = Cattle.TransitioningResource.extend({ var resource = instance.get('state'); var health = instance.get('healthState'); - if ( ['running','active','updating-active'].indexOf(resource) >= 0 && health === 'healthy' ) + if ( ['running','active','updating-active'].indexOf(resource) >= 0 && (health === 'healthy' || health === null) ) { healthy++; }