@@ -4411,22 +4411,26 @@ export class NoderedCtrl {
44114411 // this.messages = "GetNoderedInstance completed, status unknown/non existent" + "\n" + this.messages;
44124412 }
44134413 let reload : boolean = false ;
4414- this . instances . forEach ( instance => {
4415- if ( this . instance . metadata . deletionTimestamp != null ) reload = true ;
4416- if ( instance . status . phase == "deleting" || instance . status . phase == "Pending" ) reload = true ;
4417- if ( instance . metrics && instance . metrics . memory ) {
4418- if ( instance . metrics . memory . endsWith ( "Ki" ) ) {
4419- let memory : any = parseInt ( instance . metrics . memory . replace ( "Ki" , "" ) ) ;
4420- memory = Math . floor ( memory / 1024 ) + "Mi" ;
4421- instance . metrics . memory = memory ;
4422- }
4423- if ( instance . metrics . cpu . endsWith ( "n" ) ) { // nanocores or nanoCPU
4424- let cpu : any = parseInt ( instance . metrics . cpu . replace ( "n" , "" ) ) ;
4425- cpu = Math . floor ( cpu / ( 1024 * 1024 ) ) + "m" ; // 1000m = 1 vcpu
4426- instance . metrics . cpu = cpu ;
4414+ if ( this . instances ) {
4415+ this . instances . forEach ( instance => {
4416+ if ( this . instance . metadata . deletionTimestamp != null ) reload = true ;
4417+ if ( instance . status . phase == "deleting" || instance . status . phase == "Pending" ) reload = true ;
4418+ if ( instance . metrics && instance . metrics . memory ) {
4419+ if ( instance . metrics . memory . endsWith ( "Ki" ) ) {
4420+ let memory : any = parseInt ( instance . metrics . memory . replace ( "Ki" , "" ) ) ;
4421+ memory = Math . floor ( memory / 1024 ) + "Mi" ;
4422+ instance . metrics . memory = memory ;
4423+ }
4424+ if ( instance . metrics . cpu . endsWith ( "n" ) ) { // nanocores or nanoCPU
4425+ let cpu : any = parseInt ( instance . metrics . cpu . replace ( "n" , "" ) ) ;
4426+ cpu = Math . floor ( cpu / ( 1024 * 1024 ) ) + "m" ; // 1000m = 1 vcpu
4427+ instance . metrics . cpu = cpu ;
4428+ }
44274429 }
4428- }
4429- } ) ;
4430+ } ) ;
4431+ } else {
4432+ console . warn ( "GetNoderedInstance return null, did we disconnect from the openflow websocket?" ) ;
4433+ }
44304434
44314435 // this.messages = "GetNoderedInstance completed, status " + this.instancestatus + "\n" + this.messages;
44324436
0 commit comments