code: func ValidateNodeResources(node *core.Node) field.ErrorList {
  	allErrs := field.ErrorList{}
  	// Validate resource quantities in capacity.
  	hugePageSizes := sets.NewString()
  	for k, v := range node.Status.Capacity {
  		resPath := field.NewPath("status", "capacity", string(k))
  		allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...)
  		// track any huge page size that has a positive value
  		if helper.IsHugePageResourceName(k) && v.Value() > int64(0) {
  			hugePageSizes.Insert(string(k))
  		}
  		if len(hugePageSizes) > 1 {
  			allErrs = append(allErrs, field.Invalid(resPath, v, "may not have pre-allocated hugepages for multiple page sizes"))
  		}
  	}
  	// Validate resource quantities in allocatable.
  	hugePageSizes = sets.NewString()
  	for k, v := range node.Status.Allocatable {
  		resPath := field.NewPath("status", "allocatable", string(k))
  		allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, resPath)...)
  		// track any huge page size that has a positive value
  		if helper.IsHugePageResourceName(k) && v.Value() > int64(0) {
  			hugePageSizes.Insert(string(k))
  		}
  		if len(hugePageSizes) > 1 {
  			allErrs = append(allErrs, field.Invalid(resPath, v, "may not have pre-allocated hugepages for multiple page sizes"))
  		}
  	}
  	return allErrs
  }
docs: // ValidateNodeResources is used to make sure a node has valid capacity and allocatable values.