code: func (p *v1Pusher) pushRepository(ctx context.Context) error {
  	imgList, tags, referencedLayers, err := p.getImageList()
  	defer func() {
  		for _, l := range referencedLayers {
  			l.Release()
  		}
  	}()
  	if err != nil {
  		return err
  	}
  
  	imageIndex := createImageIndex(imgList, tags)
  	for _, data := range imageIndex {
  		logrus.Debugf("Pushing ID: %s with Tag: %s", data.ID, data.Tag)
  	}
  
  	// Register all the images in a repository with the registry
  	// If an image is not in this list it will not be associated with the repository
  	repoData, err := p.session.PushImageJSONIndex(p.repoInfo.Name, imageIndex, false, nil)
  	if err != nil {
  		return err
  	}
  	// push the repository to each of the endpoints only if it does not exist.
  	for _, endpoint := range repoData.Endpoints {
  		if err := p.pushImageToEndpoint(ctx, endpoint, imgList, tags, repoData); err != nil {
  			return err
  		}
  	}
  	_, err = p.session.PushImageJSONIndex(p.repoInfo.Name, imageIndex, true, repoData.Endpoints)
  	return err
  }
docs: // pushRepository pushes layers that do not already exist on the registry.