@@ -52,7 +52,7 @@ func validatePoolName(name string, fldPath *field.Path) field.ErrorList {
52
52
allErrs = append (allErrs , field .Required (fldPath , "" ))
53
53
} else {
54
54
if len (name ) > resource .PoolNameMaxLength {
55
- allErrs = append (allErrs , field .TooLong (fldPath , name , resource .PoolNameMaxLength ))
55
+ allErrs = append (allErrs , field .TooLong (fldPath , "" , resource .PoolNameMaxLength ))
56
56
}
57
57
parts := strings .Split (name , "/" )
58
58
for _ , part := range parts {
@@ -168,7 +168,7 @@ func validateCELSelector(celSelector resource.CELDeviceSelector, fldPath *field.
168
168
envType = environment .StoredExpressions
169
169
}
170
170
if len (celSelector .Expression ) > resource .CELSelectorExpressionMaxLength {
171
- allErrs = append (allErrs , field .TooLong (fldPath .Child ("expression" ), "<value omitted> " , resource .CELSelectorExpressionMaxLength ))
171
+ allErrs = append (allErrs , field .TooLong (fldPath .Child ("expression" ), "" , resource .CELSelectorExpressionMaxLength ))
172
172
// Don't bother compiling too long expressions.
173
173
return allErrs
174
174
}
@@ -561,7 +561,7 @@ func validateDeviceAttribute(attribute resource.DeviceAttribute, fldPath *field.
561
561
}
562
562
if attribute .StringValue != nil {
563
563
if len (* attribute .StringValue ) > resource .DeviceAttributeMaxValueLength {
564
- allErrs = append (allErrs , field .TooLong (fldPath .Child ("string" ), * attribute . StringValue , resource .DeviceAttributeMaxValueLength ))
564
+ allErrs = append (allErrs , field .TooLong (fldPath .Child ("string" ), "" , resource .DeviceAttributeMaxValueLength ))
565
565
}
566
566
numFields ++
567
567
}
@@ -571,7 +571,7 @@ func validateDeviceAttribute(attribute resource.DeviceAttribute, fldPath *field.
571
571
allErrs = append (allErrs , field .Invalid (fldPath .Child ("version" ), * attribute .VersionValue , "must be a string compatible with semver.org spec 2.0.0" ))
572
572
}
573
573
if len (* attribute .VersionValue ) > resource .DeviceAttributeMaxValueLength {
574
- allErrs = append (allErrs , field .TooLong (fldPath .Child ("version" ), * attribute . VersionValue , resource .DeviceAttributeMaxValueLength ))
574
+ allErrs = append (allErrs , field .TooLong (fldPath .Child ("version" ), "" , resource .DeviceAttributeMaxValueLength ))
575
575
}
576
576
}
577
577
@@ -628,7 +628,7 @@ func validateFullyQualifiedName(name resource.FullyQualifiedName, fldPath *field
628
628
func validateCIdentifier (id string , fldPath * field.Path ) field.ErrorList {
629
629
var allErrs field.ErrorList
630
630
if len (id ) > resource .DeviceMaxIDLength {
631
- allErrs = append (allErrs , field .TooLong (fldPath , id , resource .DeviceMaxIDLength ))
631
+ allErrs = append (allErrs , field .TooLong (fldPath , "" , resource .DeviceMaxIDLength ))
632
632
}
633
633
for _ , msg := range validation .IsCIdentifier (id ) {
634
634
allErrs = append (allErrs , field .TypeInvalid (fldPath , id , msg ))
0 commit comments