Skip to content

Commit c966729

Browse files
committed
move check op is error check
1 parent 8c92dd6 commit c966729

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

pkg/gce-cloud-provider/compute/gce-compute.go

+3-13
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,7 @@ func (cloud *CloudProvider) deleteZonalDisk(ctx context.Context, project, zone,
587587
if err != nil {
588588
return err
589589
}
590-
// if op != nil {
591590
klog.V(5).Infof("DeleteDisk operation %s for disk %s", op.Name, name)
592-
// }
593591
return nil
594592
}
595593

@@ -606,9 +604,7 @@ func (cloud *CloudProvider) deleteRegionalDisk(ctx context.Context, project, reg
606604
if err != nil {
607605
return err
608606
}
609-
// if op != nil {
610607
klog.V(5).Infof("DeleteDisk operation %s for disk %s", op.Name, name)
611-
// }
612608
return nil
613609
}
614610

@@ -636,9 +632,7 @@ func (cloud *CloudProvider) AttachDisk(ctx context.Context, project string, volK
636632
if err != nil {
637633
return fmt.Errorf("failed when waiting for zonal op: %v", err)
638634
}
639-
// if op != nil {
640635
klog.V(5).Infof("AttachDisk operation %s for disk %s", op.Name, attachedDiskV1.DeviceName)
641-
// }
642636
return nil
643637
}
644638

@@ -652,9 +646,7 @@ func (cloud *CloudProvider) DetachDisk(ctx context.Context, project, deviceName,
652646
if err != nil {
653647
return err
654648
}
655-
if op != nil {
656-
klog.V(5).Infof("DetachDisk operation %s for disk %s", op.Name, deviceName)
657-
}
649+
klog.V(5).Infof("DetachDisk operation %s for disk %s", op.Name, deviceName)
658650
return nil
659651
}
660652

@@ -868,9 +860,8 @@ func (cloud *CloudProvider) resizeZonalDisk(ctx context.Context, project string,
868860
if err != nil {
869861
return -1, fmt.Errorf("failed waiting for op for zonal resize for %s: %v", volKey.String(), err)
870862
}
871-
// if op != nil {
863+
872864
klog.V(5).Infof("ResizeDisk operation %s for disk %s", op.Name, volKey.Name)
873-
// }
874865
return requestGb, nil
875866
}
876867

@@ -888,9 +879,8 @@ func (cloud *CloudProvider) resizeRegionalDisk(ctx context.Context, project stri
888879
if err != nil {
889880
return -1, fmt.Errorf("failed waiting for op for regional resize for %s: %v", volKey.String(), err)
890881
}
891-
// if op != nil {
882+
892883
klog.V(5).Infof("ResizeDisk operation %s for disk %s", op.Name, volKey.Name)
893-
// }
894884
return requestGb, nil
895885
}
896886

0 commit comments

Comments
 (0)