code: func extractMaxValue(field intstr.IntOrString, name string, value int) (int, error) {
  	switch field.Type {
  	case intstr.Int:
  		if field.IntVal < 0 {
  			return 0, fmt.Errorf("%s must be >= 0", name)
  		}
  		return field.IntValue(), nil
  	case intstr.String:
  		s := strings.Replace(field.StrVal, "%", "", -1)
  		v, err := strconv.Atoi(s)
  		if err != nil {
  			return 0, fmt.Errorf("invalid %s value %q: %v", name, field.StrVal, err)
  		}
  		if v < 0 {
  			return 0, fmt.Errorf("%s must be >= 0", name)
  		}
  		return int(math.Ceil(float64(value) * (float64(v)) / 100)), nil
  	}
  	return 0, fmt.Errorf("invalid kind %q for %s", field.Type, name)
  }
docs: // func extractMaxValue is a helper to extract config max values as either
  // absolute numbers or based on percentages of the given value.