@@ -38,22 +38,22 @@ type GCEControllerServer struct {
38
38
}
39
39
40
40
const (
41
- // MaxVolumeSize is the maximum standard and ssd size of 64TB
42
- MaxVolumeSize int64 = 64000000000000
43
- DefaultVolumeSize int64 = 5000000000
44
- MinimumDiskSizeInGb = 5
41
+ // MaxVolumeSizeInBytes is the maximum standard and ssd size of 64TB
42
+ MaxVolumeSizeInBytes int64 = 64 * 1024 * 1024 * 1024 * 1024
43
+ MinimumVolumeSizeInBytes int64 = 5 * 1024 * 1024 * 1024
44
+ MinimumDiskSizeInGb = 5
45
45
46
46
DiskTypeSSD = "pd-ssd"
47
47
DiskTypeStandard = "pd-standard"
48
48
diskTypeDefault = DiskTypeStandard
49
49
50
- diskTypePersistent = "PERSISTENT"
50
+ attachableDiskTypePersistent = "PERSISTENT"
51
51
)
52
52
53
53
func getRequestCapacity (capRange * csi.CapacityRange ) (capBytes int64 ) {
54
54
// TODO: Take another look at these casts/caps. Make sure this func is correct
55
55
if capRange == nil {
56
- capBytes = DefaultVolumeSize
56
+ capBytes = MinimumVolumeSizeInBytes
57
57
return
58
58
}
59
59
@@ -63,8 +63,8 @@ func getRequestCapacity(capRange *csi.CapacityRange) (capBytes int64) {
63
63
capBytes = tcap
64
64
}
65
65
// Too small, default
66
- if capBytes < DefaultVolumeSize {
67
- capBytes = DefaultVolumeSize
66
+ if capBytes < MinimumVolumeSizeInBytes {
67
+ capBytes = MinimumVolumeSizeInBytes
68
68
}
69
69
return
70
70
}
@@ -185,7 +185,7 @@ func (gceCS *GCEControllerServer) CreateVolume(ctx context.Context, req *csi.Cre
185
185
186
186
func (gceCS * GCEControllerServer ) DeleteVolume (ctx context.Context , req * csi.DeleteVolumeRequest ) (* csi.DeleteVolumeResponse , error ) {
187
187
// TODO: Only allow deletion of volumes that were created by the driver
188
- // Assuming ID is of form {project}/{ zone}/{id}
188
+ // Assuming ID is of form {zone}/{id}
189
189
glog .Infof ("DeleteVolume called with request %v" , * req )
190
190
191
191
// Validate arguments
@@ -282,7 +282,7 @@ func (gceCS *GCEControllerServer) ControllerPublishVolume(ctx context.Context, r
282
282
Kind : disk .Kind ,
283
283
Mode : readWrite ,
284
284
Source : source ,
285
- Type : diskTypePersistent ,
285
+ Type : attachableDiskTypePersistent ,
286
286
}
287
287
288
288
glog .Infof ("Attaching disk %#v to instance %v" , attachedDiskV1 , nodeID )
0 commit comments