code: func (na *cnmNetworkAllocator) resolveIPAM(n *api.Network) (ipamapi.Ipam, string, map[string]string, error) {
  	dName := ipamapi.DefaultIPAM
  	if n.Spec.IPAM != nil && n.Spec.IPAM.Driver != nil && n.Spec.IPAM.Driver.Name != "" {
  		dName = n.Spec.IPAM.Driver.Name
  	}
  
  	var dOptions map[string]string
  	if n.Spec.IPAM != nil && n.Spec.IPAM.Driver != nil && len(n.Spec.IPAM.Driver.Options) != 0 {
  		dOptions = n.Spec.IPAM.Driver.Options
  	}
  
  	ipam, _ := na.drvRegistry.IPAM(dName)
  	if ipam == nil {
  		return nil, "", nil, fmt.Errorf("could not resolve IPAM driver %s", dName)
  	}
  
  	return ipam, dName, dOptions, nil
  }
docs: // Resolve the IPAM driver