Skip to content

Commit f1627fe

Browse files
committed
code review
1 parent 39f0616 commit f1627fe

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

internal/namespaces/instance/v1/custom_server.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,13 @@ func serverGetBuilder(c *core.Command) *core.Command {
441441
customVol.State = blockVol.Status.String()
442442
customVol.CreationDate = blockVol.CreatedAt
443443
customVol.ModificationDate = blockVol.UpdatedAt
444-
if *blockVol.Specs.PerfIops == 5000 {
445-
customVol.IOPS = "5K"
446-
} else {
447-
customVol.IOPS = "15K"
444+
if blockVol.Specs != nil && blockVol.Specs.PerfIops != nil {
445+
switch *blockVol.Specs.PerfIops {
446+
case 5000:
447+
customVol.IOPS = "5K"
448+
case 15000:
449+
customVol.IOPS = "15K"
450+
}
448451
}
449452
} else {
450453
instanceVol, err := instance.NewAPI(client).GetVolume(&instance.GetVolumeRequest{

0 commit comments

Comments
 (0)