mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
address feedback
This commit is contained in:
parent
9ba536c2e4
commit
97f9819f7e
1 changed files with 2 additions and 0 deletions
|
|
@ -544,6 +544,8 @@ func validateAllocationConfigSource(source resource.AllocationConfigSource, fldP
|
|||
// ValidateDeviceClass validates a DeviceClass.
|
||||
func ValidateDeviceClass(class *resource.DeviceClass) field.ErrorList {
|
||||
validateClassName := func(fldPath *field.Path, name string) field.ErrorList {
|
||||
// validate.LongName doesn't respect operation type currently (CREATE or UPDATE)
|
||||
// so it is ok to use operation.Operation{} here
|
||||
return validate.LongName(context.Background(), operation.Operation{}, fldPath, &name, nil).MarkCoveredByDeclarative()
|
||||
}
|
||||
allErrs := corevalidation.ValidateObjectMetaWithOpts(&class.ObjectMeta, false, validateClassName, field.NewPath("metadata"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue