@@ -63,7 +63,7 @@ const isNotIntegerErrorMsg string = `must be an integer`
63
63
const isNotPositiveErrorMsg string = `must be greater than zero`
64
64
65
65
var pdPartitionErrorMsg string = validation .InclusiveRangeError (1 , 255 )
66
- var fileModeErrorMsg string = "must be a number between 0 and 0777 (octal), both inclusive"
66
+ var fileModeErrorMsg = "must be a number between 0 and 0777 (octal), both inclusive"
67
67
68
68
// BannedOwners is a black list of object that are not allowed to be owners.
69
69
var BannedOwners = apimachineryvalidation .BannedOwners
@@ -1305,8 +1305,8 @@ func validateAzureDisk(azure *core.AzureDiskVolumeSource, fldPath *field.Path) f
1305
1305
var supportedCachingModes = sets .NewString (string (core .AzureDataDiskCachingNone ), string (core .AzureDataDiskCachingReadOnly ), string (core .AzureDataDiskCachingReadWrite ))
1306
1306
var supportedDiskKinds = sets .NewString (string (core .AzureSharedBlobDisk ), string (core .AzureDedicatedBlobDisk ), string (core .AzureManagedDisk ))
1307
1307
1308
- diskUriSupportedManaged := []string {"/subscriptions/{sub-id}/resourcegroups/{group-name}/providers/microsoft.compute/disks/{disk-id}" }
1309
- diskUriSupportedblob := []string {"https://{account-name}.blob.core.windows.net/{container-name}/{disk-name}.vhd" }
1308
+ diskURISupportedManaged := []string {"/subscriptions/{sub-id}/resourcegroups/{group-name}/providers/microsoft.compute/disks/{disk-id}" }
1309
+ diskURISupportedblob := []string {"https://{account-name}.blob.core.windows.net/{container-name}/{disk-name}.vhd" }
1310
1310
1311
1311
allErrs := field.ErrorList {}
1312
1312
if azure .DiskName == "" {
@@ -1327,11 +1327,11 @@ func validateAzureDisk(azure *core.AzureDiskVolumeSource, fldPath *field.Path) f
1327
1327
1328
1328
// validate that DiskUri is the correct format
1329
1329
if azure .Kind != nil && * azure .Kind == core .AzureManagedDisk && strings .Index (azure .DataDiskURI , "/subscriptions/" ) != 0 {
1330
- allErrs = append (allErrs , field .NotSupported (fldPath .Child ("diskURI" ), azure .DataDiskURI , diskUriSupportedManaged ))
1330
+ allErrs = append (allErrs , field .NotSupported (fldPath .Child ("diskURI" ), azure .DataDiskURI , diskURISupportedManaged ))
1331
1331
}
1332
1332
1333
1333
if azure .Kind != nil && * azure .Kind != core .AzureManagedDisk && strings .Index (azure .DataDiskURI , "https://" ) != 0 {
1334
- allErrs = append (allErrs , field .NotSupported (fldPath .Child ("diskURI" ), azure .DataDiskURI , diskUriSupportedblob ))
1334
+ allErrs = append (allErrs , field .NotSupported (fldPath .Child ("diskURI" ), azure .DataDiskURI , diskURISupportedblob ))
1335
1335
}
1336
1336
1337
1337
return allErrs
@@ -4709,8 +4709,8 @@ func ValidateResourceRequirements(requirements *core.ResourceRequirements, fldPa
4709
4709
allErrs := field.ErrorList {}
4710
4710
limPath := fldPath .Child ("limits" )
4711
4711
reqPath := fldPath .Child ("requests" )
4712
- limContainsCpuOrMemory := false
4713
- reqContainsCpuOrMemory := false
4712
+ limContainsCPUOrMemory := false
4713
+ reqContainsCPUOrMemory := false
4714
4714
limContainsHugePages := false
4715
4715
reqContainsHugePages := false
4716
4716
supportedQoSComputeResources := sets .NewString (string (core .ResourceCPU ), string (core .ResourceMemory ))
@@ -4728,7 +4728,7 @@ func ValidateResourceRequirements(requirements *core.ResourceRequirements, fldPa
4728
4728
}
4729
4729
4730
4730
if supportedQoSComputeResources .Has (string (resourceName )) {
4731
- limContainsCpuOrMemory = true
4731
+ limContainsCPUOrMemory = true
4732
4732
}
4733
4733
}
4734
4734
for resourceName , quantity := range requirements .Requests {
@@ -4754,11 +4754,11 @@ func ValidateResourceRequirements(requirements *core.ResourceRequirements, fldPa
4754
4754
reqContainsHugePages = true
4755
4755
}
4756
4756
if supportedQoSComputeResources .Has (string (resourceName )) {
4757
- reqContainsCpuOrMemory = true
4757
+ reqContainsCPUOrMemory = true
4758
4758
}
4759
4759
4760
4760
}
4761
- if ! limContainsCpuOrMemory && ! reqContainsCpuOrMemory && (reqContainsHugePages || limContainsHugePages ) {
4761
+ if ! limContainsCPUOrMemory && ! reqContainsCPUOrMemory && (reqContainsHugePages || limContainsHugePages ) {
4762
4762
allErrs = append (allErrs , field .Forbidden (fldPath , fmt .Sprintf ("HugePages require cpu or memory" )))
4763
4763
}
4764
4764
0 commit comments