@@ -170,15 +170,15 @@ func getFSInfo(m mount.Interface, path string) (string, string, error) {
170
170
if ! okMountpoint {
171
171
mountpoint , err = detectMountpoint (m , path )
172
172
if err != nil {
173
- return "" , "" , fmt .Errorf ("Cannot determine mountpoint for %s: %v" , path , err )
173
+ return "" , "" , fmt .Errorf ("cannot determine mountpoint for %s: %v" , path , err )
174
174
}
175
175
}
176
176
177
177
backingDev , okBackingDev := backingDevMap [path ]
178
178
if ! okBackingDev {
179
179
backingDev , err = detectBackingDev (m , mountpoint )
180
180
if err != nil {
181
- return "" , "" , fmt .Errorf ("Cannot determine backing device for %s: %v" , path , err )
181
+ return "" , "" , fmt .Errorf ("cannot determine backing device for %s: %v" , path , err )
182
182
}
183
183
}
184
184
mountpointMap [path ] = mountpoint
@@ -306,11 +306,11 @@ func SupportsQuotas(m mount.Interface, path string) (bool, error) {
306
306
//lint:ignore SA4009 poduid is overwritten by design, see comment below
307
307
func AssignQuota (m mount.Interface , path string , poduid types.UID , bytes * resource.Quantity ) error {
308
308
if bytes == nil {
309
- return fmt .Errorf ("Attempting to assign null quota to %s" , path )
309
+ return fmt .Errorf ("attempting to assign null quota to %s" , path )
310
310
}
311
311
ibytes := bytes .Value ()
312
312
if ok , err := SupportsQuotas (m , path ); ! ok {
313
- return fmt .Errorf ("Quotas not supported on %s: %v" , path , err )
313
+ return fmt .Errorf ("quotas not supported on %s: %v" , path , err )
314
314
}
315
315
quotaLock .Lock ()
316
316
defer quotaLock .Unlock ()
@@ -321,20 +321,20 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour
321
321
// one quota per volume, we can rip all of the pod code out.
322
322
poduid = types .UID (uuid .NewUUID ())
323
323
if pod , ok := dirPodMap [path ]; ok && pod != poduid {
324
- return fmt .Errorf ("Requesting quota on existing directory %s but different pod %s %s" , path , pod , poduid )
324
+ return fmt .Errorf ("requesting quota on existing directory %s but different pod %s %s" , path , pod , poduid )
325
325
}
326
326
oid , ok := podQuotaMap [poduid ]
327
327
if ok {
328
328
if quotaSizeMap [oid ] != ibytes {
329
- return fmt .Errorf ("Requesting quota of different size: old %v new %v" , quotaSizeMap [oid ], bytes )
329
+ return fmt .Errorf ("requesting quota of different size: old %v new %v" , quotaSizeMap [oid ], bytes )
330
330
}
331
331
} else {
332
332
oid = common .BadQuotaID
333
333
}
334
334
id , err := createProjectID (path , oid )
335
335
if err == nil {
336
336
if oid != common .BadQuotaID && oid != id {
337
- return fmt .Errorf ("Attempt to reassign quota %v to %v" , oid , id )
337
+ return fmt .Errorf ("attempt to reassign quota %v to %v" , oid , id )
338
338
}
339
339
// When enforcing quotas are enabled, we'll condition this
340
340
// on their being disabled also.
@@ -353,7 +353,7 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour
353
353
}
354
354
removeProjectID (path , id )
355
355
}
356
- return fmt .Errorf ("Assign quota FAILED %v" , err )
356
+ return fmt .Errorf ("assign quota FAILED %v" , err )
357
357
}
358
358
359
359
// GetConsumption -- retrieve the consumption (in bytes) of the directory
@@ -396,7 +396,7 @@ func GetInodes(path string) (*resource.Quantity, error) {
396
396
func ClearQuota (m mount.Interface , path string ) error {
397
397
klog .V (3 ).Infof ("ClearQuota %s" , path )
398
398
if ! enabledQuotasForMonitoring () {
399
- return fmt .Errorf ("ClearQuota called, but quotas disabled" )
399
+ return fmt .Errorf ("clearQuota called, but quotas disabled" )
400
400
}
401
401
quotaLock .Lock ()
402
402
defer quotaLock .Unlock ()
@@ -413,7 +413,7 @@ func ClearQuota(m mount.Interface, path string) error {
413
413
}
414
414
_ , ok = podQuotaMap [poduid ]
415
415
if ! ok {
416
- return fmt .Errorf ("ClearQuota : No quota available for %s" , path )
416
+ return fmt .Errorf ("clearQuota : No quota available for %s" , path )
417
417
}
418
418
projid , err := getQuotaOnDir (m , path )
419
419
if err != nil {
@@ -422,7 +422,7 @@ func ClearQuota(m mount.Interface, path string) error {
422
422
klog .V (3 ).Infof ("Attempt to check quota ID %v on dir %s failed: %v" , dirQuotaMap [path ], path , err )
423
423
}
424
424
if projid != dirQuotaMap [path ] {
425
- return fmt .Errorf ("Expected quota ID %v on dir %s does not match actual %v" , dirQuotaMap [path ], path , projid )
425
+ return fmt .Errorf ("expected quota ID %v on dir %s does not match actual %v" , dirQuotaMap [path ], path , projid )
426
426
}
427
427
count , ok := podDirCountMap [poduid ]
428
428
if count <= 1 || ! ok {
@@ -446,7 +446,7 @@ func ClearQuota(m mount.Interface, path string) error {
446
446
delete (supportsQuotasMap , path )
447
447
clearApplier (path )
448
448
if err != nil {
449
- return fmt .Errorf ("Unable to clear quota for %s: %v" , path , err )
449
+ return fmt .Errorf ("unable to clear quota for %s: %v" , path , err )
450
450
}
451
451
return nil
452
452
}
0 commit comments