code: func sanitize(nodeRes []*api.GenericResource, nodeAvailableResources *[]*api.GenericResource) {
  	// - We add the sanitized resources at the end, after
  	// having removed the elements from the list
  
  	// - When a set changes to a Discrete we also need
  	// to make sure that we don't add the Discrete multiple
  	// time hence, the need of a map to remember that
  	var sanitized []*api.GenericResource
  	kindSanitized := make(map[string]struct{})
  	w := 0
  
  	for _, na := range *nodeAvailableResources {
  		ok, nrs := sanitizeResource(nodeRes, na)
  		if !ok {
  			if _, ok = kindSanitized[Kind(na)]; ok {
  				continue
  			}
  
  			kindSanitized[Kind(na)] = struct{}{}
  			sanitized = append(sanitized, nrs...)
  
  			continue
  		}
  
  		(*nodeAvailableResources)[w] = na
  		w++
  	}
  
  	*nodeAvailableResources = (*nodeAvailableResources)[:w]
  	*nodeAvailableResources = append(*nodeAvailableResources, sanitized...)
  }
docs: // sanitize checks that nodeAvailableResources does not add resources unknown
  // to the nodeSpec (nodeRes) or goes over the integer bound specified
  // by the spec.
  // Note this is because the user is able to update a node's resources