code: func getMaxMountAndExistenceCheckAttempts(layer PushLayer) (maxMountAttempts, maxExistenceCheckAttempts int, checkOtherRepositories bool) {
  	size, err := layer.Size()
  	switch {
  	// big blob
  	case size > middleLayerMaximumSize:
  		// 1st attempt to mount the blob few times
  		// 2nd few existence checks with digests associated to any repository
  		// then fallback to upload
  		return 4, 3, true
  
  	// middle sized blobs; if we could not get the size, assume we deal with middle sized blob
  	case size > smallLayerMaximumSize, err != nil:
  		// 1st attempt to mount blobs of average size few times
  		// 2nd try at most 1 existence check if there's an existing mapping to the target repository
  		// then fallback to upload
  		return 3, 1, false
  
  	// small blobs, do a minimum number of checks
  	default:
  		return 1, 1, false
  	}
  }
docs: // getMaxMountAndExistenceCheckAttempts returns a maximum number of cross repository mount attempts from
  // source repositories of target registry, maximum number of layer existence checks performed on the target
  // repository and whether the check shall be done also with digests mapped to different repositories. The
  // decision is based on layer size. The smaller the layer, the fewer attempts shall be made because the cost
  // of upload does not outweigh a latency.