File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -357,6 +357,12 @@ func (view *NodeView) populateNodeStats(timeout time.Duration) (err error) {
357
357
if stats := view .Report .NodeStats ; stats != nil {
358
358
for _ , s := range stats {
359
359
s .Percent = map [string ]string {}
360
+ if s .Capacity == nil {
361
+ s .Capacity = map [string ]string {}
362
+ }
363
+ if s .Usage == nil {
364
+ s .Usage = map [string ]string {}
365
+ }
360
366
memory := string (coreV1 .ResourceMemory )
361
367
if s .Percent [memory ], err = s .processResourcePercent (s , memory , populateMemoryResource ); err != nil {
362
368
return errors .Trace (err )
@@ -383,7 +389,10 @@ func (view *NodeView) populateNodeStats(timeout time.Duration) (err error) {
383
389
}
384
390
385
391
func populateGPUStats (s * NodeStats , extension interface {}) {
386
- stats , _ := extension .(map [string ]interface {})
392
+ stats , ok := extension .(map [string ]interface {})
393
+ if ! ok {
394
+ return
395
+ }
387
396
if val , ok := stats [KeyGPUUsedMemory ]; ok {
388
397
used , _ := val .(float64 )
389
398
s .Usage [ResourceGPU ] = strconv .FormatFloat (used , 'f' , - 1 , 64 )
You can’t perform that action at this time.
0 commit comments