code: func (c *ChartDownloader) scanReposForURL(u string, rf *repo.RepoFile) (*repo.Entry, error) {
  	// FIXME: This is far from optimal. Larger installations and index files will
  	// incur a performance hit for this type of scanning.
  	for _, rc := range rf.Repositories {
  		r, err := repo.NewChartRepository(rc, c.Getters)
  		if err != nil {
  			return nil, err
  		}
  
  		i, err := repo.LoadIndexFile(c.HelmHome.CacheIndex(r.Config.Name))
  		if err != nil {
  			return nil, fmt.Errorf("no cached repo found. (try 'helm repo update'). %s", err)
  		}
  
  		for _, entry := range i.Entries {
  			for _, ver := range entry {
  				for _, dl := range ver.URLs {
  					if urlutil.Equal(u, dl) {
  						return rc, nil
  					}
  				}
  			}
  		}
  	}
  	// This means that there is no repo file for the given URL.
  	return nil, ErrNoOwnerRepo
  }
docs: // scanReposForURL scans all repos to find which repo contains the given URL.
  //
  // This will attempt to find the given URL in all of the known repositories files.
  //
  // If the URL is found, this will return the repo entry that contained that URL.
  //
  // If all of the repos are checked, but the URL is not found, an ErrNoOwnerRepo
  // error is returned.
  //
  // Other errors may be returned when repositories cannot be loaded or searched.
  //
  // Technically, the fact that a URL is not found in a repo is not a failure indication.
  // Charts are not required to be included in an index before they are valid. So
  // be mindful of this case.
  //
  // The same URL can technically exist in two or more repositories. This algorithm
  // will return the first one it finds. Order is determined by the order of repositories
  // in the repositories.yaml file.