Skip to content

Commit 17766dc

Browse files
authored
Merge pull request #135 from lpabon/b134
Allow describing a node even when no stats
2 parents a1d9dc0 + 781160b commit 17766dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

handler/volume/describe.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ func (p *VolumeDescribeFormatter) addVolumeStatsInfo(
296296
v *api.Volume,
297297
t *tabby.Tabby,
298298
) error {
299-
stats, err := p.volumes.GetStats(v, false)
300-
if err != nil {
301-
return err
302-
}
299+
300+
// Ignore the error if it cannot get stats
301+
stats, _ := p.volumes.GetStats(v, false)
302+
303303
t.AddLine("Stats:")
304304
t.AddLine(" Reads:", stats.GetReads())
305305
t.AddLine(" Reads MS:", stats.GetReadMs())
@@ -308,7 +308,7 @@ func (p *VolumeDescribeFormatter) addVolumeStatsInfo(
308308
t.AddLine(" Writes MS:", stats.GetWriteMs())
309309
t.AddLine(" Bytes Written:", stats.GetWriteBytes())
310310
t.AddLine(" IOs in progress:", stats.GetIoProgress())
311-
t.AddLine(" Bytes used:", humanize.BigIBytes(big.NewInt(int64(stats.BytesUsed))))
311+
t.AddLine(" Bytes used:", humanize.BigIBytes(big.NewInt(int64(stats.GetBytesUsed()))))
312312
return nil
313313
}
314314

0 commit comments

Comments
 (0)