code: func shouldV2Fallback(err errcode.Error) bool {
  	switch err.Code {
  	case errcode.ErrorCodeUnauthorized, v2.ErrorCodeManifestUnknown, v2.ErrorCodeNameUnknown:
  		return true
  	}
  	return false
  }
docs: // shouldV2Fallback returns true if this error is a reason to fall back to v1.