diff --git a/api/swagger.yml b/api/swagger.yml index 8bbd763c01f..039303747f9 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -184,6 +184,9 @@ components: description: Unix Epoch in seconds default_branch: type: string + storage_id: + type: string + description: Unique identifier of the underlying data store storage_namespace: type: string description: Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/") @@ -264,6 +267,9 @@ components: name: type: string pattern: "^[a-z0-9][a-z0-9-]{2,62}$" + storage_id: + type: string + description: Unique identifier of the underlying data store storage_namespace: type: string description: 'Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/")' diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index 6e89ca447db..458f93d2741 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -7501,6 +7501,7 @@ components: Repository: example: read_only: true + storage_id: storage_id default_branch: default_branch id: id creation_date: 0 @@ -7514,6 +7515,9 @@ components: type: integer default_branch: type: string + storage_id: + description: Unique identifier of the underlying data store + type: string storage_namespace: description: Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/") type: string @@ -7566,11 +7570,13 @@ components: results: 0 results: - read_only: true + storage_id: storage_id default_branch: default_branch id: id creation_date: 0 storage_namespace: storage_namespace - read_only: true + storage_id: storage_id default_branch: default_branch id: id creation_date: 0 @@ -7619,6 +7625,7 @@ components: example: sample_data: true read_only: true + storage_id: storage_id name: name default_branch: main storage_namespace: s3://example-bucket/ @@ -7626,6 +7633,9 @@ components: name: pattern: "^[a-z0-9][a-z0-9-]{2,62}$" type: string + storage_id: + description: Unique identifier of the underlying data store + type: string storage_namespace: description: Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/") example: s3://example-bucket/ diff --git a/clients/java/docs/Repository.md b/clients/java/docs/Repository.md index e5e9808dbf6..eb00c5451e9 100644 --- a/clients/java/docs/Repository.md +++ b/clients/java/docs/Repository.md @@ -10,6 +10,7 @@ |**id** | **String** | | | |**creationDate** | **Long** | Unix Epoch in seconds | | |**defaultBranch** | **String** | | | +|**storageId** | **String** | Unique identifier of the underlying data store | [optional] | |**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | | |**readOnly** | **Boolean** | Whether the repository is a read-only repository- not relevant for bare repositories | [optional] | diff --git a/clients/java/docs/RepositoryCreation.md b/clients/java/docs/RepositoryCreation.md index c44ad50dbf7..d104df63524 100644 --- a/clients/java/docs/RepositoryCreation.md +++ b/clients/java/docs/RepositoryCreation.md @@ -8,6 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**name** | **String** | | | +|**storageId** | **String** | Unique identifier of the underlying data store | [optional] | |**storageNamespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | | |**defaultBranch** | **String** | | [optional] | |**sampleData** | **Boolean** | | [optional] | diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java index 4978119e72b..82f960d76c8 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java @@ -64,6 +64,10 @@ public class Repository { @SerializedName(SERIALIZED_NAME_DEFAULT_BRANCH) private String defaultBranch; + public static final String SERIALIZED_NAME_STORAGE_ID = "storage_id"; + @SerializedName(SERIALIZED_NAME_STORAGE_ID) + private String storageId; + public static final String SERIALIZED_NAME_STORAGE_NAMESPACE = "storage_namespace"; @SerializedName(SERIALIZED_NAME_STORAGE_NAMESPACE) private String storageNamespace; @@ -138,6 +142,27 @@ public void setDefaultBranch(String defaultBranch) { } + public Repository storageId(String storageId) { + + this.storageId = storageId; + return this; + } + + /** + * Unique identifier of the underlying data store + * @return storageId + **/ + @javax.annotation.Nullable + public String getStorageId() { + return storageId; + } + + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public Repository storageNamespace(String storageNamespace) { this.storageNamespace = storageNamespace; @@ -237,6 +262,7 @@ public boolean equals(Object o) { return Objects.equals(this.id, repository.id) && Objects.equals(this.creationDate, repository.creationDate) && Objects.equals(this.defaultBranch, repository.defaultBranch) && + Objects.equals(this.storageId, repository.storageId) && Objects.equals(this.storageNamespace, repository.storageNamespace) && Objects.equals(this.readOnly, repository.readOnly)&& Objects.equals(this.additionalProperties, repository.additionalProperties); @@ -244,7 +270,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, creationDate, defaultBranch, storageNamespace, readOnly, additionalProperties); + return Objects.hash(id, creationDate, defaultBranch, storageId, storageNamespace, readOnly, additionalProperties); } @Override @@ -254,6 +280,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); sb.append(" defaultBranch: ").append(toIndentedString(defaultBranch)).append("\n"); + sb.append(" storageId: ").append(toIndentedString(storageId)).append("\n"); sb.append(" storageNamespace: ").append(toIndentedString(storageNamespace)).append("\n"); sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -282,6 +309,7 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("creation_date"); openapiFields.add("default_branch"); + openapiFields.add("storage_id"); openapiFields.add("storage_namespace"); openapiFields.add("read_only"); @@ -319,6 +347,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("default_branch").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `default_branch` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_branch").toString())); } + if ((jsonObj.get("storage_id") != null && !jsonObj.get("storage_id").isJsonNull()) && !jsonObj.get("storage_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `storage_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_id").toString())); + } if (!jsonObj.get("storage_namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `storage_namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_namespace").toString())); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java index fdbf5b1e8ec..dbfa5f29e41 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java @@ -56,6 +56,10 @@ public class RepositoryCreation { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public static final String SERIALIZED_NAME_STORAGE_ID = "storage_id"; + @SerializedName(SERIALIZED_NAME_STORAGE_ID) + private String storageId; + public static final String SERIALIZED_NAME_STORAGE_NAMESPACE = "storage_namespace"; @SerializedName(SERIALIZED_NAME_STORAGE_NAMESPACE) private String storageNamespace; @@ -96,6 +100,27 @@ public void setName(String name) { } + public RepositoryCreation storageId(String storageId) { + + this.storageId = storageId; + return this; + } + + /** + * Unique identifier of the underlying data store + * @return storageId + **/ + @javax.annotation.Nullable + public String getStorageId() { + return storageId; + } + + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public RepositoryCreation storageNamespace(String storageNamespace) { this.storageNamespace = storageNamespace; @@ -235,6 +260,7 @@ public boolean equals(Object o) { } RepositoryCreation repositoryCreation = (RepositoryCreation) o; return Objects.equals(this.name, repositoryCreation.name) && + Objects.equals(this.storageId, repositoryCreation.storageId) && Objects.equals(this.storageNamespace, repositoryCreation.storageNamespace) && Objects.equals(this.defaultBranch, repositoryCreation.defaultBranch) && Objects.equals(this.sampleData, repositoryCreation.sampleData) && @@ -244,7 +270,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, storageNamespace, defaultBranch, sampleData, readOnly, additionalProperties); + return Objects.hash(name, storageId, storageNamespace, defaultBranch, sampleData, readOnly, additionalProperties); } @Override @@ -252,6 +278,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RepositoryCreation {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" storageId: ").append(toIndentedString(storageId)).append("\n"); sb.append(" storageNamespace: ").append(toIndentedString(storageNamespace)).append("\n"); sb.append(" defaultBranch: ").append(toIndentedString(defaultBranch)).append("\n"); sb.append(" sampleData: ").append(toIndentedString(sampleData)).append("\n"); @@ -280,6 +307,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("name"); + openapiFields.add("storage_id"); openapiFields.add("storage_namespace"); openapiFields.add("default_branch"); openapiFields.add("sample_data"); @@ -314,6 +342,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } + if ((jsonObj.get("storage_id") != null && !jsonObj.get("storage_id").isJsonNull()) && !jsonObj.get("storage_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `storage_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_id").toString())); + } if (!jsonObj.get("storage_namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `storage_namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_namespace").toString())); } diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryCreationTest.java index 7fc4f4a7746..40baad5ebc4 100644 --- a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryCreationTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryCreationTest.java @@ -45,6 +45,14 @@ public void nameTest() { // TODO: test name } + /** + * Test the property 'storageId' + */ + @Test + public void storageIdTest() { + // TODO: test storageId + } + /** * Test the property 'storageNamespace' */ diff --git a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryTest.java b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryTest.java index ba349e17a31..aebd28faca0 100644 --- a/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/sdk/model/RepositoryTest.java @@ -61,6 +61,14 @@ public void defaultBranchTest() { // TODO: test defaultBranch } + /** + * Test the property 'storageId' + */ + @Test + public void storageIdTest() { + // TODO: test storageId + } + /** * Test the property 'storageNamespace' */ diff --git a/clients/python/docs/Repository.md b/clients/python/docs/Repository.md index 9a26acf43dd..34c8b4b83ff 100644 --- a/clients/python/docs/Repository.md +++ b/clients/python/docs/Repository.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **id** | **str** | | **creation_date** | **int** | Unix Epoch in seconds | **default_branch** | **str** | | +**storage_id** | **str** | Unique identifier of the underlying data store | [optional] **storage_namespace** | **str** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | **read_only** | **bool** | Whether the repository is a read-only repository- not relevant for bare repositories | [optional] diff --git a/clients/python/docs/RepositoryCreation.md b/clients/python/docs/RepositoryCreation.md index f63db7b4a2d..dca25858a08 100644 --- a/clients/python/docs/RepositoryCreation.md +++ b/clients/python/docs/RepositoryCreation.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | +**storage_id** | **str** | Unique identifier of the underlying data store | [optional] **storage_namespace** | **str** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | **default_branch** | **str** | | [optional] **sample_data** | **bool** | | [optional] [default to False] diff --git a/clients/python/lakefs_sdk/models/repository.py b/clients/python/lakefs_sdk/models/repository.py index 44bfd179541..df34e6034ca 100644 --- a/clients/python/lakefs_sdk/models/repository.py +++ b/clients/python/lakefs_sdk/models/repository.py @@ -32,9 +32,10 @@ class Repository(BaseModel): id: StrictStr = Field(...) creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") default_branch: StrictStr = Field(...) + storage_id: Optional[StrictStr] = Field(None, description="Unique identifier of the underlying data store") storage_namespace: StrictStr = Field(..., description="Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\")") read_only: Optional[StrictBool] = Field(None, description="Whether the repository is a read-only repository- not relevant for bare repositories") - __properties = ["id", "creation_date", "default_branch", "storage_namespace", "read_only"] + __properties = ["id", "creation_date", "default_branch", "storage_id", "storage_namespace", "read_only"] class Config: """Pydantic configuration""" @@ -75,6 +76,7 @@ def from_dict(cls, obj: dict) -> Repository: "id": obj.get("id"), "creation_date": obj.get("creation_date"), "default_branch": obj.get("default_branch"), + "storage_id": obj.get("storage_id"), "storage_namespace": obj.get("storage_namespace"), "read_only": obj.get("read_only") }) diff --git a/clients/python/lakefs_sdk/models/repository_creation.py b/clients/python/lakefs_sdk/models/repository_creation.py index c53ace2d59b..88452c5edfe 100644 --- a/clients/python/lakefs_sdk/models/repository_creation.py +++ b/clients/python/lakefs_sdk/models/repository_creation.py @@ -30,11 +30,12 @@ class RepositoryCreation(BaseModel): RepositoryCreation """ name: constr(strict=True) = Field(...) + storage_id: Optional[StrictStr] = Field(None, description="Unique identifier of the underlying data store") storage_namespace: constr(strict=True) = Field(..., description="Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\")") default_branch: Optional[StrictStr] = None sample_data: Optional[StrictBool] = False read_only: Optional[StrictBool] = False - __properties = ["name", "storage_namespace", "default_branch", "sample_data", "read_only"] + __properties = ["name", "storage_id", "storage_namespace", "default_branch", "sample_data", "read_only"] @validator('name') def name_validate_regular_expression(cls, value): @@ -87,6 +88,7 @@ def from_dict(cls, obj: dict) -> RepositoryCreation: _obj = RepositoryCreation.parse_obj({ "name": obj.get("name"), + "storage_id": obj.get("storage_id"), "storage_namespace": obj.get("storage_namespace"), "default_branch": obj.get("default_branch"), "sample_data": obj.get("sample_data") if obj.get("sample_data") is not None else False, diff --git a/clients/python/test/test_repository.py b/clients/python/test/test_repository.py index 7ba2d7937fa..34fc696a290 100644 --- a/clients/python/test/test_repository.py +++ b/clients/python/test/test_repository.py @@ -42,6 +42,7 @@ def make_instance(self, include_optional): id = '', creation_date = 56, default_branch = '', + storage_id = '', storage_namespace = '', read_only = True ) diff --git a/clients/python/test/test_repository_creation.py b/clients/python/test/test_repository_creation.py index 731d0d188f4..4d69f26d3be 100644 --- a/clients/python/test/test_repository_creation.py +++ b/clients/python/test/test_repository_creation.py @@ -40,6 +40,7 @@ def make_instance(self, include_optional): if include_optional : return RepositoryCreation( name = 'wr1c2v7s6djuy1zmeto', + storage_id = '', storage_namespace = 's3://example-bucket/', default_branch = 'main', sample_data = True, diff --git a/clients/python/test/test_repository_list.py b/clients/python/test/test_repository_list.py index 72beb45a0b5..6667a001ae7 100644 --- a/clients/python/test/test_repository_list.py +++ b/clients/python/test/test_repository_list.py @@ -49,6 +49,7 @@ def make_instance(self, include_optional): id = '', creation_date = 56, default_branch = '', + storage_id = '', storage_namespace = '', read_only = True, ) ] @@ -65,6 +66,7 @@ def make_instance(self, include_optional): id = '', creation_date = 56, default_branch = '', + storage_id = '', storage_namespace = '', read_only = True, ) ], diff --git a/clients/rust/docs/Repository.md b/clients/rust/docs/Repository.md index 66325f4be96..8ed0507d956 100644 --- a/clients/rust/docs/Repository.md +++ b/clients/rust/docs/Repository.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **id** | **String** | | **creation_date** | **i64** | Unix Epoch in seconds | **default_branch** | **String** | | +**storage_id** | Option<**String**> | Unique identifier of the underlying data store | [optional] **storage_namespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | **read_only** | Option<**bool**> | Whether the repository is a read-only repository- not relevant for bare repositories | [optional] diff --git a/clients/rust/docs/RepositoryCreation.md b/clients/rust/docs/RepositoryCreation.md index e046f41463c..feed234e0ed 100644 --- a/clients/rust/docs/RepositoryCreation.md +++ b/clients/rust/docs/RepositoryCreation.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | | +**storage_id** | Option<**String**> | Unique identifier of the underlying data store | [optional] **storage_namespace** | **String** | Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") | **default_branch** | Option<**String**> | | [optional] **sample_data** | Option<**bool**> | | [optional][default to false] diff --git a/clients/rust/src/models/repository.rs b/clients/rust/src/models/repository.rs index 0c1eb05c539..c1917fe1b4e 100644 --- a/clients/rust/src/models/repository.rs +++ b/clients/rust/src/models/repository.rs @@ -19,6 +19,9 @@ pub struct Repository { pub creation_date: i64, #[serde(rename = "default_branch")] pub default_branch: String, + /// Unique identifier of the underlying data store + #[serde(rename = "storage_id", skip_serializing_if = "Option::is_none")] + pub storage_id: Option, /// Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") #[serde(rename = "storage_namespace")] pub storage_namespace: String, @@ -33,6 +36,7 @@ impl Repository { id, creation_date, default_branch, + storage_id: None, storage_namespace, read_only: None, } diff --git a/clients/rust/src/models/repository_creation.rs b/clients/rust/src/models/repository_creation.rs index fe5b8286445..43a0b4c1396 100644 --- a/clients/rust/src/models/repository_creation.rs +++ b/clients/rust/src/models/repository_creation.rs @@ -14,6 +14,9 @@ use crate::models; pub struct RepositoryCreation { #[serde(rename = "name")] pub name: String, + /// Unique identifier of the underlying data store + #[serde(rename = "storage_id", skip_serializing_if = "Option::is_none")] + pub storage_id: Option, /// Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") #[serde(rename = "storage_namespace")] pub storage_namespace: String, @@ -29,6 +32,7 @@ impl RepositoryCreation { pub fn new(name: String, storage_namespace: String) -> RepositoryCreation { RepositoryCreation { name, + storage_id: None, storage_namespace, default_branch: None, sample_data: None, diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index 8bbd763c01f..039303747f9 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -184,6 +184,9 @@ components: description: Unix Epoch in seconds default_branch: type: string + storage_id: + type: string + description: Unique identifier of the underlying data store storage_namespace: type: string description: Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/") @@ -264,6 +267,9 @@ components: name: type: string pattern: "^[a-z0-9][a-z0-9-]{2,62}$" + storage_id: + type: string + description: Unique identifier of the underlying data store storage_namespace: type: string description: 'Filesystem URI to store the underlying data in (e.g. "s3://my-bucket/some/path/")' diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 79a0447635c..b4e7a9867da 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -1907,6 +1907,7 @@ func (c *Controller) ListRepositories(w http.ResponseWriter, r *http.Request, pa creationDate := repo.CreationDate.Unix() r := apigen.Repository{ Id: repo.Name, + StorageId: swag.String(repo.StorageID), StorageNamespace: repo.StorageNamespace, CreationDate: creationDate, DefaultBranch: repo.DefaultBranch, @@ -1976,6 +1977,8 @@ func (c *Controller) CreateRepository(w http.ResponseWriter, r *http.Request, bo defaultBranch = "main" } + storageID := swag.StringValue(body.StorageId) + if !swag.BoolValue(body.ReadOnly) { if err := c.ensureStorageNamespace(ctx, body.StorageNamespace); err != nil { var ( @@ -2010,7 +2013,7 @@ func (c *Controller) CreateRepository(w http.ResponseWriter, r *http.Request, bo if swag.BoolValue(params.Bare) { // create a bare repository. This is useful in conjunction with refs-restore to create a copy // of another repository by e.g. copying the _lakefs/ directory and restoring its refs - repo, err := c.Catalog.CreateBareRepository(ctx, body.Name, body.StorageNamespace, defaultBranch, swag.BoolValue(body.ReadOnly)) + repo, err := c.Catalog.CreateBareRepository(ctx, body.Name, storageID, body.StorageNamespace, defaultBranch, swag.BoolValue(body.ReadOnly)) if c.handleAPIError(ctx, w, r, err) { return } @@ -2018,13 +2021,14 @@ func (c *Controller) CreateRepository(w http.ResponseWriter, r *http.Request, bo CreationDate: repo.CreationDate.Unix(), DefaultBranch: repo.DefaultBranch, Id: repo.Name, + StorageId: swag.String(repo.StorageID), StorageNamespace: repo.StorageNamespace, } writeResponse(w, r, http.StatusCreated, response) return } - newRepo, err := c.Catalog.CreateRepository(ctx, body.Name, body.StorageNamespace, defaultBranch, swag.BoolValue(body.ReadOnly)) + newRepo, err := c.Catalog.CreateRepository(ctx, body.Name, storageID, body.StorageNamespace, defaultBranch, swag.BoolValue(body.ReadOnly)) if err != nil { c.handleAPIError(ctx, w, r, fmt.Errorf("error creating repository: %w", err)) return @@ -2055,6 +2059,7 @@ func (c *Controller) CreateRepository(w http.ResponseWriter, r *http.Request, bo CreationDate: newRepo.CreationDate.Unix(), DefaultBranch: newRepo.DefaultBranch, Id: newRepo.Name, + StorageId: swag.String(newRepo.StorageID), StorageNamespace: newRepo.StorageNamespace, ReadOnly: swag.Bool(newRepo.ReadOnly), } @@ -2164,6 +2169,7 @@ func (c *Controller) GetRepository(w http.ResponseWriter, r *http.Request, repos CreationDate: repo.CreationDate.Unix(), DefaultBranch: repo.DefaultBranch, Id: repo.Name, + StorageId: swag.String(repo.StorageID), StorageNamespace: repo.StorageNamespace, ReadOnly: swag.Bool(repo.ReadOnly), } diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index 173dad9cac3..c7e1302f936 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -101,11 +101,11 @@ func TestController_ListRepositoriesHandler(t *testing.T) { t.Run("list some repos", func(t *testing.T) { // write some repos ctx := context.Background() - _, err := deps.catalog.CreateRepository(ctx, "foo1", onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, "foo1", "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) - _, err = deps.catalog.CreateRepository(ctx, "foo2", onBlock(deps, "foo1"), "main", false) + _, err = deps.catalog.CreateRepository(ctx, "foo2", "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) - _, err = deps.catalog.CreateRepository(ctx, "foo3", onBlock(deps, "foo1"), "main", false) + _, err = deps.catalog.CreateRepository(ctx, "foo3", "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) resp, err := clt.ListRepositoriesWithResponse(ctx, &apigen.ListRepositoriesParams{}) @@ -186,7 +186,7 @@ func TestController_GetRepoHandler(t *testing.T) { t.Run("get existing repo", func(t *testing.T) { const testBranchName = "non-default" - _, err := deps.catalog.CreateRepository(context.Background(), "foo1", onBlock(deps, "foo1"), testBranchName, false) + _, err := deps.catalog.CreateRepository(context.Background(), "foo1", "", onBlock(deps, "foo1"), testBranchName, false) testutil.Must(t, err) resp, err := clt.GetRepositoryWithResponse(ctx, "foo1") @@ -240,7 +240,7 @@ func TestController_LogCommitsMissingBranch(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "ns1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "ns1"), "main", false) testutil.Must(t, err) resp, err := clt.LogCommitsWithResponse(ctx, repo, "otherbranch", &apigen.LogCommitsParams{}) @@ -297,7 +297,7 @@ func TestController_LogCommitsHandler(t *testing.T) { tt := ttt t.Run(tt.name, func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) const prefix = "foo/bar" @@ -338,7 +338,7 @@ func TestController_LogCommitsParallelHandler(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) commits := 100 @@ -386,7 +386,7 @@ func TestController_LogCommitsPredefinedData(t *testing.T) { // prepare test data repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) const prefix = "foo/bar" const totalCommits = 10 @@ -580,7 +580,7 @@ func TestController_CommitsGetBranchCommitLogByPath(t *testing.T) { */ repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "ns1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "ns1"), "main", false) testutil.Must(t, err) commitsMap := make(map[string]string) @@ -743,7 +743,7 @@ func TestController_GetCommitHandler(t *testing.T) { t.Run("get existing commit", func(t *testing.T) { ctx := context.Background() - _, err := deps.catalog.CreateRepository(ctx, "foo1", onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, "foo1", "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, "foo1", "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) commit1, err := deps.catalog.Commit(ctx, "foo1", "main", "some message", DefaultUserID, nil, nil, nil, false) @@ -767,7 +767,7 @@ func TestController_GetCommitHandler(t *testing.T) { t.Run("branch commit", func(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) commit1, err := deps.catalog.Commit(ctx, repo, "main", "some message", DefaultUserID, nil, nil, nil, false) @@ -795,7 +795,7 @@ func TestController_GetCommitHandler(t *testing.T) { t.Run("tag commit", func(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) commit1, err := deps.catalog.Commit(ctx, repo, "main", "some message", DefaultUserID, nil, nil, nil, false) @@ -820,7 +820,7 @@ func TestController_GetCommitHandler(t *testing.T) { t.Run("initial commit", func(t *testing.T) { // validate a new repository's initial commit existence and structure ctx := context.Background() - _, err := deps.catalog.CreateRepository(ctx, "foo2", onBlock(deps, "foo2"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, "foo2", "", onBlock(deps, "foo2"), "main", false) testutil.Must(t, err) resp, err := clt.GetCommitWithResponse(ctx, "foo2", "main") verifyResponseOK(t, resp, err) @@ -871,7 +871,7 @@ func TestController_CommitHandler(t *testing.T) { t.Run("commit success", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, fmt.Sprintf("create repo %s", repo), err) testutil.MustDo(t, fmt.Sprintf("commit bar on %s", repo), deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar", PhysicalAddress: "pa", CreationDate: time.Now(), Size: 666, Checksum: "cs", Metadata: nil})) resp, err := clt.CommitWithResponse(ctx, repo, "main", &apigen.CommitParams{}, apigen.CommitJSONRequestBody{ @@ -882,7 +882,7 @@ func TestController_CommitHandler(t *testing.T) { t.Run("commit success with source metarange", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, fmt.Sprintf("create repo %s", repo), err) _, err = deps.catalog.CreateBranch(ctx, repo, "foo-branch", "main") @@ -901,7 +901,7 @@ func TestController_CommitHandler(t *testing.T) { t.Run("commit failure with source metarange and dirty branch", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, fmt.Sprintf("create repo %s", repo), err) _, err = deps.catalog.CreateBranch(ctx, repo, "foo-branch", "main") @@ -926,7 +926,7 @@ func TestController_CommitHandler(t *testing.T) { t.Run("commit failure empty branch", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, fmt.Sprintf("create repo %s", repo), err) _, err = deps.catalog.CreateBranch(ctx, repo, "foo-branch", "main") @@ -944,7 +944,7 @@ func TestController_CommitHandler(t *testing.T) { t.Run("commit success - with creation date", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, fmt.Sprintf("create repo %s", repo), err) testutil.MustDo(t, fmt.Sprintf("commit bar on %s", repo), deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar", PhysicalAddress: "pa", CreationDate: time.Now(), Size: 666, Checksum: "cs", Metadata: nil})) date := int64(1642626109) @@ -960,7 +960,7 @@ func TestController_CommitHandler(t *testing.T) { t.Run("protected branch", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, "create repository", err) rules := map[string]*graveler.BranchProtectionBlockedActions{ "main": { @@ -985,7 +985,7 @@ func TestController_CommitHandler(t *testing.T) { }) t.Run("read only repo", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", true) testutil.MustDo(t, "create repository", err) err = deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar", PhysicalAddress: "pa", CreationDate: time.Now(), Size: 666, Checksum: "cs", Metadata: nil}) require.Error(t, err, "read-only repository") @@ -1015,6 +1015,7 @@ func TestController_CreateRepositoryHandler(t *testing.T) { resp, err := clt.CreateRepositoryWithResponse(ctx, &apigen.CreateRepositoryParams{}, apigen.CreateRepositoryJSONRequestBody{ DefaultBranch: apiutil.Ptr("main"), Name: repoName, + StorageId: swag.String(""), StorageNamespace: onBlock(deps, "foo-bucket-1"), }) verifyResponseOK(t, resp, err) @@ -1028,6 +1029,24 @@ func TestController_CreateRepositoryHandler(t *testing.T) { } }) + t.Run("create repo no StorageId success", func(t *testing.T) { + repoName := testUniqueRepoName() + resp, err := clt.CreateRepositoryWithResponse(ctx, &apigen.CreateRepositoryParams{}, apigen.CreateRepositoryJSONRequestBody{ + DefaultBranch: apiutil.Ptr("main"), + Name: repoName, + StorageNamespace: onBlock(deps, "foo-bucket-1-1"), + }) + verifyResponseOK(t, resp, err) + + response := resp.JSON201 + if response == nil { + t.Fatal("CreateRepository got bad response") + } + if response.Id != repoName { + t.Fatalf("CreateRepository id=%s, expected=%s", response.Id, repoName) + } + }) + t.Run("create bare repo success", func(t *testing.T) { repoName := testUniqueRepoName() bareRepo := true @@ -1052,7 +1071,7 @@ func TestController_CreateRepositoryHandler(t *testing.T) { t.Run("create repo duplicate", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) if err != nil { t.Fatal(err) } @@ -1153,7 +1172,7 @@ func TestController_DeleteRepositoryHandler(t *testing.T) { t.Run("delete repo success", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) resp, err := clt.DeleteRepositoryWithResponse(ctx, repo, &apigen.DeleteRepositoryParams{}) @@ -1179,7 +1198,7 @@ func TestController_DeleteRepositoryHandler(t *testing.T) { t.Run("delete repo doesnt delete other repos", func(t *testing.T) { names := []string{"rr0", "rr1", "rr11", "rr2"} for _, name := range names { - _, err := deps.catalog.CreateRepository(ctx, name, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, name, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) } @@ -1199,7 +1218,7 @@ func TestController_DeleteRepositoryHandler(t *testing.T) { t.Run("delete read-only repository", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", true) testutil.Must(t, err) resp, err := clt.DeleteRepositoryWithResponse(ctx, repo, &apigen.DeleteRepositoryParams{}) @@ -1457,7 +1476,7 @@ func TestController_ListBranchesHandler(t *testing.T) { t.Run("list branches only default", func(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) resp, err := clt.ListBranchesWithResponse(ctx, repo, &apigen.ListBranchesParams{ Amount: apiutil.Ptr(apigen.PaginationAmount(-1)), @@ -1474,7 +1493,7 @@ func TestController_ListBranchesHandler(t *testing.T) { t.Run("list branches pagination", func(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo2"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo2"), "main", false) testutil.Must(t, err) // create the first "dummy" commit on main so that we can create branches from it @@ -1544,7 +1563,7 @@ func TestController_ListTagsHandler(t *testing.T) { // setup test data repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) testutil.Must(t, deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "obj1"})) commitLog, err := deps.catalog.Commit(ctx, repo, "main", "first commit", "test", nil, nil, nil, false) @@ -1626,7 +1645,7 @@ func TestController_GetBranchHandler(t *testing.T) { const testBranch = "main" repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), testBranch, false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), testBranch, false) testutil.Must(t, err) t.Run("get default branch", func(t *testing.T) { @@ -1670,7 +1689,7 @@ func TestController_BranchesDiffBranchHandler(t *testing.T) { ctx := context.Background() const testBranch = "main" repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), testBranch, false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), testBranch, false) if err != nil { t.Fatal(err) } @@ -1722,7 +1741,7 @@ func TestController_CreateBranchHandler(t *testing.T) { t.Run(fmt.Sprintf("hidden=%v", hidden), func(t *testing.T) { t.Run("create branch and diff refs success", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) testutil.Must(t, deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "a/b"})) _, err = deps.catalog.Commit(ctx, repo, "main", "first commit", "test", nil, nil, nil, false) @@ -1761,7 +1780,7 @@ func TestController_CreateBranchHandler(t *testing.T) { t.Run("create branch missing commit", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) resp, err := clt.CreateBranchWithResponse(ctx, repo, apigen.CreateBranchJSONRequestBody{ Name: "main3", @@ -1793,7 +1812,7 @@ func TestController_CreateBranchHandler(t *testing.T) { t.Run("create branch conflict with branch", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) resp, err := clt.CreateBranchWithResponse(ctx, repo, apigen.CreateBranchJSONRequestBody{ @@ -1811,7 +1830,7 @@ func TestController_CreateBranchHandler(t *testing.T) { t.Run("create branch conflict with tag", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) name := "tag123" @@ -1833,7 +1852,7 @@ func TestController_CreateBranchHandler(t *testing.T) { t.Run("create branch conflict with commit", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) log, err := deps.catalog.GetCommit(ctx, repo, "main") @@ -1854,7 +1873,7 @@ func TestController_CreateBranchHandler(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", true) testutil.Must(t, err) testutil.Must(t, deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "a/b"}, graveler.WithForce(true))) _, err = deps.catalog.Commit(ctx, repo, "main", "first commit", "test", nil, nil, nil, false, graveler.WithForce(true)) @@ -1889,7 +1908,7 @@ func TestController_DiffRefsHandler(t *testing.T) { t.Run("diff prefix with and without delimiter", func(t *testing.T) { repoName := testUniqueRepoName() const newBranchName = "main2" - _, err := deps.catalog.CreateRepository(ctx, repoName, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repoName, "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) resp, err := clt.CreateBranchWithResponse(ctx, repoName, apigen.CreateBranchJSONRequestBody{ @@ -1975,7 +1994,7 @@ func TestController_UploadObjectHandler(t *testing.T) { clt, deps := setupClientWithAdmin(t) ctx := context.Background() - _, err := deps.catalog.CreateRepository(ctx, "my-new-repo", onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, "my-new-repo", "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) t.Run("upload object", func(t *testing.T) { @@ -2120,7 +2139,7 @@ func TestController_UploadObjectHandler(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { repoName := "my-new-read-only-repo" - _, err := deps.catalog.CreateRepository(ctx, repoName, onBlock(deps, "foo2"), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repoName, "", onBlock(deps, "foo2"), "main", true) testutil.Must(t, err) // write contentType, buf := writeMultipart("content", "bar", "hello world!") @@ -2151,7 +2170,7 @@ func TestController_DeleteBranchHandler(t *testing.T) { ctx := context.Background() t.Run("delete branch success", func(t *testing.T) { - _, err := deps.catalog.CreateRepository(ctx, "my-new-repo", onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, "my-new-repo", "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) testutil.Must(t, deps.catalog.CreateEntry(ctx, "my-new-repo", "main", catalog.DBEntry{Path: "a/b"})) _, err = deps.catalog.Commit(ctx, "my-new-repo", "main", "first commit", "test", nil, nil, nil, false) @@ -2172,7 +2191,7 @@ func TestController_DeleteBranchHandler(t *testing.T) { }) t.Run("delete default branch", func(t *testing.T) { - _, err := deps.catalog.CreateRepository(ctx, "my-new-repo2", onBlock(deps, "foo2"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, "my-new-repo2", "", onBlock(deps, "foo2"), "main", false) testutil.Must(t, err) resp, err := clt.DeleteBranchWithResponse(ctx, "my-new-repo2", "main", &apigen.DeleteBranchParams{}) if err != nil { @@ -2195,7 +2214,7 @@ func TestController_DeleteBranchHandler(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { repoName := "read-only-repo" - _, err := deps.catalog.CreateRepository(ctx, repoName, onBlock(deps, "foo1"), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repoName, "", onBlock(deps, "foo1"), "main", true) testutil.Must(t, err) testutil.Must(t, deps.catalog.CreateEntry(ctx, repoName, "main", catalog.DBEntry{Path: "a/b"}, graveler.WithForce(true))) _, err = deps.catalog.Commit(ctx, repoName, "main", "first commit", "test", nil, nil, nil, false, graveler.WithForce(true)) @@ -2226,7 +2245,7 @@ func TestController_ObjectsStatObjectHandler(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "some-bucket"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "some-bucket"), "main", false) if err != nil { t.Fatal(err) } @@ -2323,7 +2342,7 @@ func TestController_UpdateObjectUserMetadataHander(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "some-bucket"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "some-bucket"), "main", false) if err != nil { t.Fatal(err) } @@ -2426,7 +2445,7 @@ func TestController_ObjectsListObjectsHandler(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "bucket/prefix"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "bucket/prefix"), "main", false) testutil.Must(t, err) dbEntries := []catalog.DBEntry{ { @@ -2521,7 +2540,7 @@ func TestController_ObjectsHeadObjectHandler(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "ns1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "ns1"), "main", false) if err != nil { t.Fatal(err) } @@ -2597,7 +2616,7 @@ func TestController_ObjectsGetObjectHandler(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "ns1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "ns1"), "main", false) if err != nil { t.Fatal(err) } @@ -2757,7 +2776,7 @@ func TestController_ObjectsUploadObjectHandler(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "bucket/prefix"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "bucket/prefix"), "main", false) if err != nil { t.Fatal(err) } @@ -2818,7 +2837,7 @@ func TestController_ObjectsUploadObjectHandler(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { readOnlyRepo := testUniqueRepoName() path := "foo/bar" - _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, onBlock(deps, "bucket/prefix"), "main", true) + _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, "", onBlock(deps, "bucket/prefix"), "main", true) if err != nil { t.Fatal(err) } @@ -2891,7 +2910,7 @@ func TestController_ObjectsStageObjectHandler(t *testing.T) { ctx := context.Background() ns := onBlock(deps, "bucket/prefix") repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, ns, "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", ns, "main", false) if err != nil { t.Fatal(err) } @@ -2981,7 +3000,7 @@ func TestController_ObjectsStageObjectHandler(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { readOnlyRepo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, onBlock(deps, "bucket/prefix"), "main", true) + _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, "", onBlock(deps, "bucket/prefix"), "main", true) if err != nil { t.Fatal(err) } @@ -3077,7 +3096,7 @@ func TestController_ObjectsDeleteObjectHandler(t *testing.T) { repo := testUniqueRepoName() const branch = "main" - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "some-bucket/prefix"), branch, false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "some-bucket/prefix"), branch, false) if err != nil { t.Fatal(err) } @@ -3240,7 +3259,7 @@ func TestController_ObjectsDeleteObjectHandler(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { readOnlyRepo := testUniqueRepoName() const branch = "main" - _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, onBlock(deps, "some-bucket/prefix2"), branch, true) + _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, "", onBlock(deps, "some-bucket/prefix2"), branch, true) if err != nil { t.Fatal(err) } @@ -3612,6 +3631,7 @@ func TestController_ListRepositoryRuns(t *testing.T) { resp, err := clt.CreateRepositoryWithResponse(ctx, &apigen.CreateRepositoryParams{}, apigen.CreateRepositoryJSONRequestBody{ DefaultBranch: apiutil.Ptr("main"), Name: repo, + StorageId: swag.String(""), StorageNamespace: "mem://repo9", }) verifyResponseOK(t, resp, err) @@ -3770,7 +3790,7 @@ func TestController_MergeIntoExplicitBranch(t *testing.T) { // setup env repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) _, err = deps.catalog.CreateBranch(ctx, repo, "branch1", "main") testutil.Must(t, err) @@ -3812,7 +3832,7 @@ func TestController_MergeSquashing(t *testing.T) { // setup env repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) base, err := deps.catalog.CreateBranch(ctx, repo, "branch", "main") testutil.Must(t, err) @@ -3882,7 +3902,7 @@ func TestController_MergeDirtyBranch(t *testing.T) { // setup env repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) err = deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"}) testutil.Must(t, err) @@ -3945,7 +3965,7 @@ func TestController_CreateTag(t *testing.T) { ctx := context.Background() // setup env repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) commit1, err := deps.catalog.Commit(ctx, repo, "main", "some message", DefaultUserID, nil, nil, nil, false) @@ -4055,7 +4075,7 @@ func TestController_CreateTag(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { readOnlyRepo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, onBlock(deps, readOnlyRepo), "main", true) + _, err := deps.catalog.CreateRepository(ctx, readOnlyRepo, "", onBlock(deps, readOnlyRepo), "main", true) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, readOnlyRepo, "main", catalog.DBEntry{Path: "foo/bar2", PhysicalAddress: "bar2addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"}, graveler.WithForce(true))) commit1, err := deps.catalog.Commit(ctx, readOnlyRepo, "main", "some message", DefaultUserID, nil, nil, nil, false, graveler.WithForce(true)) @@ -4086,7 +4106,7 @@ func TestController_Revert(t *testing.T) { ctx := context.Background() // setup env repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) _, err = deps.catalog.Commit(ctx, repo, "main", "some message", DefaultUserID, nil, nil, nil, false) @@ -4135,7 +4155,7 @@ func TestController_Revert(t *testing.T) { t.Run("revert_no_parent", func(t *testing.T) { repo := testUniqueRepoName() // setup data - repo with one object committed - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) err = deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "merge/foo/bar1", PhysicalAddress: "merge1bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"}) testutil.Must(t, err) @@ -4162,7 +4182,7 @@ func TestController_Revert(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { readOnlyRepository := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, readOnlyRepository, onBlock(deps, readOnlyRepository), "main", true) + _, err := deps.catalog.CreateRepository(ctx, readOnlyRepository, "", onBlock(deps, readOnlyRepository), "main", true) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, readOnlyRepository, "main", catalog.DBEntry{Path: "foo/bar2", PhysicalAddress: "bar2addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"}, graveler.WithForce(true))) _, err = deps.catalog.Commit(ctx, readOnlyRepository, "main", "some message", DefaultUserID, nil, nil, nil, false, graveler.WithForce(true)) @@ -4182,7 +4202,7 @@ func TestController_RevertConflict(t *testing.T) { ctx := context.Background() // setup env repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) firstCommit, err := deps.catalog.Commit(ctx, repo, "main", "some message", DefaultUserID, nil, nil, nil, false) @@ -4203,7 +4223,7 @@ func TestController_CherryPick(t *testing.T) { ctx := context.Background() // setup env repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) _, err = deps.catalog.Commit(ctx, repo, "main", "message1", DefaultUserID, nil, nil, nil, false) @@ -4361,7 +4381,7 @@ func TestController_CherryPick(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { readOnlyRepository := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, readOnlyRepository, onBlock(deps, readOnlyRepository), "main", true) + _, err := deps.catalog.CreateRepository(ctx, readOnlyRepository, "", onBlock(deps, readOnlyRepository), "main", true) testutil.Must(t, err) for _, name := range []string{"branch1", "dest-branch1"} { _, err = deps.catalog.CreateBranch(ctx, readOnlyRepository, name, "main", graveler.WithForce(true)) @@ -4439,10 +4459,11 @@ func TestController_GetPhysicalAddress(t *testing.T) { t.Run("physical_address_format", func(t *testing.T) { repo := testUniqueRepoName() const ( + sid = "" ns = "s3://foo-bucket1" branch = "main" ) - _, err := deps.catalog.CreateRepository(ctx, repo, ns, branch, false) + _, err := deps.catalog.CreateRepository(ctx, repo, sid, ns, branch, false) if err != nil { t.Fatal(err) } @@ -4553,7 +4574,7 @@ func TestController_PrepareGarbageCollectionUncommitted(t *testing.T) { t.Run("uncommitted_data", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) const items = 3 for i := 0; i < items; i++ { @@ -4566,7 +4587,7 @@ func TestController_PrepareGarbageCollectionUncommitted(t *testing.T) { t.Run("committed_data", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) const items = 3 for i := 0; i < items; i++ { @@ -4582,7 +4603,7 @@ func TestController_PrepareGarbageCollectionUncommitted(t *testing.T) { t.Run("uncommitted_copy", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) const items = 3 for i := 0; i < items; i++ { @@ -4602,7 +4623,7 @@ func TestController_PrepareGarbageCollectionUncommitted(t *testing.T) { t.Run("read_only_repo", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", true) testutil.Must(t, err) resp, err := clt.PrepareGarbageCollectionUncommittedWithResponse(ctx, repo, apigen.PrepareGarbageCollectionUncommittedJSONRequestBody{}) if err != nil { @@ -4620,7 +4641,7 @@ func TestController_PrepareGarbageCollectionCommitted(t *testing.T) { t.Run("read_only_repo", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", true) testutil.Must(t, err) resp, err := clt.PrepareGarbageCollectionCommitsWithResponse(ctx, repo) if err != nil { @@ -4643,7 +4664,7 @@ func TestController_ClientDisconnect(t *testing.T) { // setup repository ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) // prepare a client that will not wait for a response and timeout @@ -4923,7 +4944,7 @@ func TestController_CopyObjectHandler(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "bucket/prefix"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "bucket/prefix"), "main", false) require.NoError(t, err) _, err = deps.catalog.CreateBranch(ctx, repo, "alt", "main") require.NoError(t, err) @@ -5070,7 +5091,7 @@ func TestController_CopyObjectHandler(t *testing.T) { t.Run("read-only repository", func(t *testing.T) { readOnlyRepository := testUniqueRepoName() - _, err = deps.catalog.CreateRepository(ctx, readOnlyRepository, onBlock(deps, "bucket/prefix"), "main", true) + _, err = deps.catalog.CreateRepository(ctx, readOnlyRepository, "", onBlock(deps, "bucket/prefix"), "main", true) require.NoError(t, err) _, err = deps.catalog.CreateBranch(ctx, readOnlyRepository, "alt", "main", graveler.WithForce(true)) require.NoError(t, err) @@ -5145,7 +5166,7 @@ func TestController_LocalAdapter_StageObject(t *testing.T) { ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "bucket/prefix"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "bucket/prefix"), "main", false) require.NoError(t, err) _, err = deps.catalog.CreateBranch(ctx, repo, "alt", "main") require.NoError(t, err) @@ -5167,7 +5188,7 @@ func TestController_BranchProtectionRules(t *testing.T) { t.Run("admin", func(t *testing.T) { currCtx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(currCtx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(currCtx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, "create repository", err) respPreflight, err := adminClt.CreateBranchProtectionRulePreflightWithResponse(currCtx, repo) @@ -5185,7 +5206,7 @@ func TestController_BranchProtectionRules(t *testing.T) { t.Run("read-only repo", func(t *testing.T) { currCtx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(currCtx, repo, onBlock(deps, repo), "main", true) + _, err := deps.catalog.CreateRepository(currCtx, repo, "", onBlock(deps, repo), "main", true) testutil.MustDo(t, "create repository", err) resp, err := adminClt.SetBranchProtectionRulesWithResponse(currCtx, repo, &apigen.SetBranchProtectionRulesParams{}, apigen.SetBranchProtectionRulesJSONRequestBody{}) @@ -5207,7 +5228,7 @@ func TestController_GarbageCollectionRules(t *testing.T) { t.Run("admin", func(t *testing.T) { currCtx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(currCtx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(currCtx, repo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, "create repository", err) respPreflight, err := adminClt.SetGarbageCollectionRulesPreflightWithResponse(currCtx, repo) @@ -5225,7 +5246,7 @@ func TestController_GarbageCollectionRules(t *testing.T) { t.Run("read-only repo", func(t *testing.T) { currCtx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(currCtx, repo, onBlock(deps, repo), "main", true) + _, err := deps.catalog.CreateRepository(currCtx, repo, "", onBlock(deps, repo), "main", true) testutil.MustDo(t, "create repository", err) resp, err := adminClt.SetGCRulesWithResponse(currCtx, repo, apigen.SetGCRulesJSONRequestBody{ @@ -5249,7 +5270,7 @@ func TestController_DumpRestoreRepository(t *testing.T) { // setup repository with some commits repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) const commits = 3 @@ -5312,7 +5333,7 @@ func TestController_DumpRestoreRepository(t *testing.T) { } newRepo := testUniqueRepoName() - _, err = deps.catalog.CreateBareRepository(ctx, newRepo, onBlock(deps, repo), "main", false) + _, err = deps.catalog.CreateBareRepository(ctx, newRepo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, "create bare repository", err) submitResponse, err := clt.RestoreSubmitWithResponse(ctx, newRepo, apigen.RestoreSubmitJSONRequestBody{ @@ -5337,7 +5358,7 @@ func TestController_DumpRestoreRepository(t *testing.T) { t.Run("restore_invalid_refs", func(t *testing.T) { // delete and recreate repository as bare for restore newRepo := testUniqueRepoName() - _, err = deps.catalog.CreateBareRepository(ctx, newRepo, onBlock(deps, repo), "main", false) + _, err = deps.catalog.CreateBareRepository(ctx, newRepo, "", onBlock(deps, repo), "main", false) testutil.MustDo(t, "create bare repository", err) submitResponse, err := clt.RestoreSubmitWithResponse(ctx, newRepo, apigen.RestoreSubmitJSONRequestBody{ @@ -5390,7 +5411,7 @@ func TestController_CreateCommitRecord(t *testing.T) { t.Run("create commit record", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) resp, err := clt.CreateCommitRecordWithResponse(ctx, repo, body) testutil.MustDo(t, "create commit record", err) @@ -5417,7 +5438,7 @@ func TestController_CreateCommitRecord(t *testing.T) { t.Run("create commit record with wrong commitID", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) bodyCpy := body bodyCpy.CommitId = "wrong" @@ -5430,7 +5451,7 @@ func TestController_CreateCommitRecord(t *testing.T) { t.Run("read only repository", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", true) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", true) testutil.Must(t, err) resp, err := clt.CreateCommitRecordWithResponse(ctx, repo, body) testutil.Must(t, err) @@ -5447,7 +5468,7 @@ func TestController_CreateCommitRecord(t *testing.T) { t.Run("already existing commit", func(t *testing.T) { repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) testutil.Must(t, err) resp, err := clt.CreateCommitRecordWithResponse(ctx, repo, body) testutil.MustDo(t, "create commit record", err) @@ -5611,7 +5632,7 @@ func TestController_CreatePullRequest(t *testing.T) { clt, deps := setupClientWithAdmin(t) ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) require.NoError(t, err) t.Run("invalid source", func(t *testing.T) { @@ -5716,7 +5737,7 @@ func TestController_GetPullRequest(t *testing.T) { clt, deps := setupClientWithAdmin(t) ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) require.NoError(t, err) t.Run("invalid xid", func(t *testing.T) { @@ -5737,7 +5758,7 @@ func TestController_ListPullRequestsHandler(t *testing.T) { clt, deps := setupClientWithAdmin(t) ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, "foo1"), "main", false) require.NoError(t, err) t.Run("no pull requests", func(t *testing.T) { @@ -5872,7 +5893,7 @@ func TestController_UpdatePullRequest(t *testing.T) { clt, deps := setupClientWithAdmin(t) ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) require.NoError(t, err) t.Run("invalid xid", func(t *testing.T) { @@ -6024,7 +6045,7 @@ func TestController_MergePullRequest(t *testing.T) { clt, deps := setupClientWithAdmin(t) ctx := context.Background() repo := testUniqueRepoName() - _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main", false) + _, err := deps.catalog.CreateRepository(ctx, repo, "", onBlock(deps, repo), "main", false) require.NoError(t, err) t.Run("invalid xid", func(t *testing.T) { diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index 71f22e02227..1ebbb1521ee 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -446,8 +446,9 @@ func (c *Catalog) log(ctx context.Context) logging.Logger { } // CreateRepository create a new repository pointing to 'storageNamespace' (ex: s3://bucket1/repo) with default branch name 'branch' -func (c *Catalog) CreateRepository(ctx context.Context, repository string, storageNamespace string, branch string, readOnly bool) (*Repository, error) { +func (c *Catalog) CreateRepository(ctx context.Context, repository string, storageID string, storageNamespace string, branch string, readOnly bool) (*Repository, error) { repositoryID := graveler.RepositoryID(repository) + storageIdentifier := graveler.StorageID(storageID) storageNS := graveler.StorageNamespace(storageNamespace) branchID := graveler.BranchID(branch) if err := validator.Validate([]validator.ValidateArg{ @@ -456,12 +457,17 @@ func (c *Catalog) CreateRepository(ctx context.Context, repository string, stora }); err != nil { return nil, err } - repo, err := c.Store.CreateRepository(ctx, repositoryID, storageNS, branchID, readOnly) + // TODO: this is a temporary validation. we should probably move this to the store level + if storageIdentifier != "" { + return nil, graveler.ErrInvalidStorageID + } + repo, err := c.Store.CreateRepository(ctx, repositoryID, storageIdentifier, storageNS, branchID, readOnly) if err != nil { return nil, err } catalogRepo := &Repository{ Name: repositoryID.String(), + StorageID: storageIdentifier.String(), StorageNamespace: storageNS.String(), DefaultBranch: branchID.String(), CreationDate: repo.CreationDate, @@ -472,8 +478,9 @@ func (c *Catalog) CreateRepository(ctx context.Context, repository string, stora // CreateBareRepository create a new repository pointing to 'storageNamespace' (ex: s3://bucket1/repo) with no initial branch or commit // defaultBranchID will point to a non-existent branch on creation, it is up to the caller to eventually create it. -func (c *Catalog) CreateBareRepository(ctx context.Context, repository string, storageNamespace string, defaultBranchID string, readOnly bool) (*Repository, error) { +func (c *Catalog) CreateBareRepository(ctx context.Context, repository string, storageID string, storageNamespace string, defaultBranchID string, readOnly bool) (*Repository, error) { repositoryID := graveler.RepositoryID(repository) + storageIdentifier := graveler.StorageID(storageID) storageNS := graveler.StorageNamespace(storageNamespace) branchID := graveler.BranchID(defaultBranchID) if err := validator.Validate([]validator.ValidateArg{ @@ -482,12 +489,17 @@ func (c *Catalog) CreateBareRepository(ctx context.Context, repository string, s }); err != nil { return nil, err } - repo, err := c.Store.CreateBareRepository(ctx, repositoryID, storageNS, branchID, readOnly) + // TODO: this is a temporary validation. we should probably move this to the store level + if storageIdentifier != "" { + return nil, graveler.ErrInvalidStorageID + } + repo, err := c.Store.CreateBareRepository(ctx, repositoryID, storageIdentifier, storageNS, branchID, readOnly) if err != nil { return nil, err } catalogRepo := &Repository{ Name: repositoryID.String(), + StorageID: storageIdentifier.String(), StorageNamespace: storageNS.String(), DefaultBranch: branchID.String(), CreationDate: repo.CreationDate, @@ -516,6 +528,7 @@ func (c *Catalog) GetRepository(ctx context.Context, repository string) (*Reposi catalogRepository := &Repository{ Name: repositoryID.String(), + StorageID: repo.StorageID.String(), StorageNamespace: repo.StorageNamespace.String(), DefaultBranch: repo.DefaultBranchID.String(), CreationDate: repo.CreationDate, @@ -623,6 +636,7 @@ func (c *Catalog) ListRepositories(ctx context.Context, limit int, prefix, searc } repos = append(repos, &Repository{ Name: record.RepositoryID.String(), + StorageID: record.StorageID.String(), StorageNamespace: record.StorageNamespace.String(), DefaultBranch: record.DefaultBranchID.String(), CreationDate: record.CreationDate, diff --git a/pkg/catalog/catalog_test.go b/pkg/catalog/catalog_test.go index bd9d2215988..0a1679837aa 100644 --- a/pkg/catalog/catalog_test.go +++ b/pkg/catalog/catalog_test.go @@ -72,12 +72,12 @@ func TestCatalog_ListRepositories(t *testing.T) { // prepare data tests now := time.Now() gravelerData := []*graveler.RepositoryRecord{ - {RepositoryID: "re", Repository: &graveler.Repository{StorageNamespace: "storage1", CreationDate: now, DefaultBranchID: "main1"}}, - {RepositoryID: "repo1", Repository: &graveler.Repository{StorageNamespace: "storage2", CreationDate: now, DefaultBranchID: "main2"}}, - {RepositoryID: "repo2", Repository: &graveler.Repository{StorageNamespace: "storage3", CreationDate: now, DefaultBranchID: "main3"}}, - {RepositoryID: "repo22", Repository: &graveler.Repository{StorageNamespace: "storage4", CreationDate: now, DefaultBranchID: "main4"}}, - {RepositoryID: "repo23", Repository: &graveler.Repository{StorageNamespace: "storage5", CreationDate: now, DefaultBranchID: "main5"}}, - {RepositoryID: "repo3", Repository: &graveler.Repository{StorageNamespace: "storage6", CreationDate: now, DefaultBranchID: "main6"}}, + {RepositoryID: "re", Repository: &graveler.Repository{StorageID: "", StorageNamespace: "storageNS1", CreationDate: now, DefaultBranchID: "main1"}}, + {RepositoryID: "repo1", Repository: &graveler.Repository{StorageID: "", StorageNamespace: "storageNS2", CreationDate: now, DefaultBranchID: "main2"}}, + {RepositoryID: "repo2", Repository: &graveler.Repository{StorageID: "", StorageNamespace: "storageNS3", CreationDate: now, DefaultBranchID: "main3"}}, + {RepositoryID: "repo22", Repository: &graveler.Repository{StorageID: "", StorageNamespace: "storageNS4", CreationDate: now, DefaultBranchID: "main4"}}, + {RepositoryID: "repo23", Repository: &graveler.Repository{StorageID: "", StorageNamespace: "storageNS5", CreationDate: now, DefaultBranchID: "main5"}}, + {RepositoryID: "repo3", Repository: &graveler.Repository{StorageID: "", StorageNamespace: "storageNS6", CreationDate: now, DefaultBranchID: "main6"}}, } type args struct { limit int @@ -101,12 +101,12 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "re", StorageNamespace: "storage1", DefaultBranch: "main1", CreationDate: now}, - {Name: "repo1", StorageNamespace: "storage2", DefaultBranch: "main2", CreationDate: now}, - {Name: "repo2", StorageNamespace: "storage3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageNamespace: "storage4", DefaultBranch: "main4", CreationDate: now}, - {Name: "repo23", StorageNamespace: "storage5", DefaultBranch: "main5", CreationDate: now}, - {Name: "repo3", StorageNamespace: "storage6", DefaultBranch: "main6", CreationDate: now}, + {Name: "re", StorageID: "", StorageNamespace: "storageNS1", DefaultBranch: "main1", CreationDate: now}, + {Name: "repo1", StorageID: "", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, + {Name: "repo2", StorageID: "", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo23", StorageID: "", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo3", StorageID: "", StorageNamespace: "storageNS6", DefaultBranch: "main6", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -120,7 +120,7 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "re", StorageNamespace: "storage1", DefaultBranch: "main1", CreationDate: now}, + {Name: "re", StorageID: "", StorageNamespace: "storageNS1", DefaultBranch: "main1", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -134,7 +134,7 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo1", StorageNamespace: "storage2", DefaultBranch: "main2", CreationDate: now}, + {Name: "repo1", StorageID: "", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -148,8 +148,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo2", StorageNamespace: "storage3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageNamespace: "storage4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo2", StorageID: "", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -163,7 +163,7 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo1", StorageNamespace: "storage2", DefaultBranch: "main2", CreationDate: now}, + {Name: "repo1", StorageID: "", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -177,8 +177,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo23", StorageNamespace: "storage5", DefaultBranch: "main5", CreationDate: now}, - {Name: "repo3", StorageNamespace: "storage6", DefaultBranch: "main6", CreationDate: now}, + {Name: "repo23", StorageID: "", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo3", StorageID: "", StorageNamespace: "storageNS6", DefaultBranch: "main6", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -192,9 +192,9 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo2", StorageNamespace: "storage3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageNamespace: "storage4", DefaultBranch: "main4", CreationDate: now}, - {Name: "repo23", StorageNamespace: "storage5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo2", StorageID: "", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo23", StorageID: "", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -208,8 +208,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo2", StorageNamespace: "storage3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageNamespace: "storage4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo2", StorageID: "", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -223,7 +223,7 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo23", StorageNamespace: "storage5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo23", StorageID: "", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -237,8 +237,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo22", StorageNamespace: "storage4", DefaultBranch: "main4", CreationDate: now}, - {Name: "repo23", StorageNamespace: "storage5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo22", StorageID: "", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo23", StorageID: "", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, }, wantHasMore: false, wantErr: false, diff --git a/pkg/catalog/fake_graveler_test.go b/pkg/catalog/fake_graveler_test.go index 869f25fdaf6..644b1a3d813 100644 --- a/pkg/catalog/fake_graveler_test.go +++ b/pkg/catalog/fake_graveler_test.go @@ -51,7 +51,7 @@ func (g *FakeGraveler) SetGarbageCollectionRules(_ context.Context, _ *graveler. panic("implement me") } -func (g *FakeGraveler) CreateBareRepository(_ context.Context, _ graveler.RepositoryID, _ graveler.StorageNamespace, _ graveler.BranchID, _ bool) (*graveler.RepositoryRecord, error) { +func (g *FakeGraveler) CreateBareRepository(_ context.Context, _ graveler.RepositoryID, _ graveler.StorageID, _ graveler.StorageNamespace, _ graveler.BranchID, _ bool) (*graveler.RepositoryRecord, error) { panic("implement me") } @@ -148,7 +148,7 @@ func (g *FakeGraveler) GetRepository(ctx context.Context, repositoryID graveler. return &graveler.RepositoryRecord{RepositoryID: repositoryID}, nil } -func (g *FakeGraveler) CreateRepository(ctx context.Context, repositoryID graveler.RepositoryID, storageNamespace graveler.StorageNamespace, branchID graveler.BranchID, readOnly bool) (*graveler.RepositoryRecord, error) { +func (g *FakeGraveler) CreateRepository(ctx context.Context, repositoryID graveler.RepositoryID, storageID graveler.StorageID, storageNamespace graveler.StorageNamespace, branchID graveler.BranchID, readOnly bool) (*graveler.RepositoryRecord, error) { panic("implement me") } diff --git a/pkg/catalog/model.go b/pkg/catalog/model.go index 502ab0c5bbf..3f78adf392c 100644 --- a/pkg/catalog/model.go +++ b/pkg/catalog/model.go @@ -19,6 +19,7 @@ type CommitGeneration int64 type Repository struct { Name string + StorageID string StorageNamespace string DefaultBranch string CreationDate time.Time diff --git a/pkg/gateway/testutil/gateway_setup.go b/pkg/gateway/testutil/gateway_setup.go index d112b5aec95..b2eebf2a811 100644 --- a/pkg/gateway/testutil/gateway_setup.go +++ b/pkg/gateway/testutil/gateway_setup.go @@ -60,7 +60,7 @@ func GetBasicHandler(t *testing.T, authService *FakeAuthService, repoName string storageNamespace = "replay" } - _, err = c.CreateRepository(ctx, repoName, storageNamespace, "main", false) + _, err = c.CreateRepository(ctx, repoName, "", storageNamespace, "main", false) testutil.Must(t, err) handler := gateway.NewHandler(authService.Region, c, multipartTracker, blockAdapter, authService, []string{authService.BareDomain}, &stats.NullCollector{}, upload.DefaultPathProvider, nil, config.DefaultLoggingAuditLogLevel, true, false, false) diff --git a/pkg/graveler/errors.go b/pkg/graveler/errors.go index 0fb6ebf5134..6a2e4f4f702 100644 --- a/pkg/graveler/errors.go +++ b/pkg/graveler/errors.go @@ -30,6 +30,7 @@ var ( ErrInvalidTagID = fmt.Errorf("tag id: %w", ErrInvalidValue) ErrInvalid = errors.New("validation error") ErrInvalidType = fmt.Errorf("invalid type: %w", ErrInvalid) + ErrInvalidStorageID = fmt.Errorf("storage id: %w", ErrInvalidValue) ErrInvalidRepositoryID = fmt.Errorf("repository id: %w", ErrInvalidValue) ErrRequiredValue = fmt.Errorf("required value: %w", ErrInvalid) ErrCommitNotFound = fmt.Errorf("commit %w", ErrNotFound) diff --git a/pkg/graveler/graveler.go b/pkg/graveler/graveler.go index 6cfac69f9ce..c7e3389e59f 100644 --- a/pkg/graveler/graveler.go +++ b/pkg/graveler/graveler.go @@ -265,6 +265,9 @@ func WithShowHidden(v bool) ListOptionsFunc { // function/methods receiving the following basic types could assume they passed validation +// StorageID is the storage location identifier +type StorageID string + // StorageNamespace is the URI to the storage location type StorageNamespace string @@ -355,6 +358,7 @@ type Metadata map[string]string // Repository represents repository metadata type Repository struct { + StorageID StorageID StorageNamespace StorageNamespace CreationDate time.Time DefaultBranchID BranchID @@ -374,8 +378,9 @@ type RepositoryMetadata map[string]string const MetadataKeyLastImportTimeStamp = ".lakefs.last.import.timestamp" -func NewRepository(storageNamespace StorageNamespace, defaultBranchID BranchID, readOnly bool) Repository { +func NewRepository(storageID StorageID, storageNamespace StorageNamespace, defaultBranchID BranchID, readOnly bool) Repository { return Repository{ + StorageID: storageID, StorageNamespace: storageNamespace, CreationDate: time.Now().UTC(), DefaultBranchID: defaultBranchID, @@ -600,10 +605,10 @@ type VersionController interface { GetRepository(ctx context.Context, repositoryID RepositoryID) (*RepositoryRecord, error) // CreateRepository stores a new Repository under RepositoryID with the given Branch as default branch - CreateRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, branchID BranchID, readOnly bool) (*RepositoryRecord, error) + CreateRepository(ctx context.Context, repositoryID RepositoryID, storageID StorageID, storageNamespace StorageNamespace, branchID BranchID, readOnly bool) (*RepositoryRecord, error) // CreateBareRepository stores a new Repository under RepositoryID with no initial branch or commit - CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, defaultBranchID BranchID, readOnly bool) (*RepositoryRecord, error) + CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageID StorageID, storageNamespace StorageNamespace, defaultBranchID BranchID, readOnly bool) (*RepositoryRecord, error) // ListRepositories returns iterator to scan repositories ListRepositories(ctx context.Context) (RepositoryIterator, error) @@ -1095,6 +1100,10 @@ func (id RepositoryID) String() string { return string(id) } +func (id StorageID) String() string { + return string(id) +} + func (ns StorageNamespace) String() string { return string(ns) } @@ -1185,13 +1194,13 @@ func (g *Graveler) GetRepository(ctx context.Context, repositoryID RepositoryID) return g.RefManager.GetRepository(ctx, repositoryID) } -func (g *Graveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, branchID BranchID, readOnly bool) (*RepositoryRecord, error) { +func (g *Graveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, storageID StorageID, storageNamespace StorageNamespace, branchID BranchID, readOnly bool) (*RepositoryRecord, error) { _, err := g.RefManager.GetRepository(ctx, repositoryID) if err != nil && !errors.Is(err, ErrRepositoryNotFound) { return nil, err } - repo := NewRepository(storageNamespace, branchID, readOnly) + repo := NewRepository(storageID, storageNamespace, branchID, readOnly) repository, err := g.RefManager.CreateRepository(ctx, repositoryID, repo) if err != nil { return nil, err @@ -1199,13 +1208,13 @@ func (g *Graveler) CreateRepository(ctx context.Context, repositoryID Repository return repository, nil } -func (g *Graveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, defaultBranchID BranchID, readOnly bool) (*RepositoryRecord, error) { +func (g *Graveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageID StorageID, storageNamespace StorageNamespace, defaultBranchID BranchID, readOnly bool) (*RepositoryRecord, error) { _, err := g.RefManager.GetRepository(ctx, repositoryID) if err != nil && !errors.Is(err, ErrRepositoryNotFound) { return nil, err } - repo := NewRepository(storageNamespace, defaultBranchID, readOnly) + repo := NewRepository(storageID, storageNamespace, defaultBranchID, readOnly) repository, err := g.RefManager.CreateBareRepository(ctx, repositoryID, repo) if err != nil { return nil, err diff --git a/pkg/graveler/graveler.pb.go b/pkg/graveler/graveler.pb.go index 0ac0bf7bc63..914e45e84e6 100644 --- a/pkg/graveler/graveler.pb.go +++ b/pkg/graveler/graveler.pb.go @@ -174,6 +174,7 @@ type RepositoryData struct { State RepositoryState `protobuf:"varint,5,opt,name=state,proto3,enum=io.treeverse.lakefs.graveler.RepositoryState" json:"state,omitempty"` InstanceUid string `protobuf:"bytes,6,opt,name=instance_uid,json=instanceUid,proto3" json:"instance_uid,omitempty"` ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` + StorageId string `protobuf:"bytes,8,opt,name=storage_id,json=storageId,proto3" json:"storage_id,omitempty"` } func (x *RepositoryData) Reset() { @@ -257,6 +258,13 @@ func (x *RepositoryData) GetReadOnly() bool { return false } +func (x *RepositoryData) GetStorageId() string { + if x != nil { + return x.StorageId + } + return "" +} + type BranchData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1034,7 +1042,7 @@ var file_graveler_graveler_proto_rawDesc = []byte{ 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x02, 0x0a, 0x0e, 0x52, 0x65, 0x70, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x02, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, @@ -1054,170 +1062,172 @@ var file_graveler_graveler_proto_rawDesc = []byte{ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x9b, 0x01, 0x0a, 0x0a, 0x42, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6e, - 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, - 0x74, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, - 0x65, 0x61, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22, 0x36, 0x0a, 0x07, 0x54, 0x61, 0x67, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, - 0x22, 0x9e, 0x03, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, - 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x52, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, - 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, - 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x9a, 0x02, 0x0a, 0x16, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x79, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x15, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x72, 0x65, - 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, - 0x65, 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, - 0x72, 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, + 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x9b, 0x01, 0x0a, 0x0a, 0x42, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6e, 0x67, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, + 0x61, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22, 0x36, 0x0a, 0x07, 0x54, 0x61, 0x67, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22, + 0x9e, 0x03, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x5f, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x6d, 0x65, 0x74, 0x61, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, + 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, 0x6b, + 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x9a, 0x02, 0x0a, 0x16, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, + 0x73, 0x12, 0x81, 0x01, 0x0a, 0x15, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x72, 0x65, 0x74, + 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x4d, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, + 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, + 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x13, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x44, 0x61, 0x79, 0x73, 0x1a, 0x46, 0x0a, 0x18, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x13, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x1a, 0x46, 0x0a, 0x18, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x73, - 0x0a, 0x1e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x51, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, - 0x3b, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, - 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x42, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0xcb, 0x02, 0x0a, 0x15, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, - 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0xa0, 0x01, - 0x0a, 0x21, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, - 0x5f, 0x74, 0x6f, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x74, - 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, - 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, - 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x42, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x54, 0x6f, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x1d, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, - 0x54, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x1a, 0x8e, 0x01, 0x0a, 0x22, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x61, 0x74, 0x74, 0x65, - 0x72, 0x6e, 0x54, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x52, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x73, 0x0a, + 0x1e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x51, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x3b, + 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, + 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0xcb, 0x02, 0x0a, 0x15, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, + 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0xa0, 0x01, 0x0a, + 0x21, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x5f, + 0x74, 0x6f, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x56, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, - 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x53, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x92, 0x02, 0x0a, 0x10, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, - 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x64, - 0x12, 0x40, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, - 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xa1, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x70, - 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x54, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, - 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, - 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, - 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc5, 0x03, 0x0a, - 0x0f, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x47, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x2f, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, - 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, - 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x2d, 0x0a, 0x12, 0x64, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6c, - 0x6f, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x08, 0x63, 0x6c, 0x6f, - 0x73, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x2a, 0x2e, 0x0a, 0x0f, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, - 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x49, - 0x4f, 0x4e, 0x10, 0x01, 0x2a, 0x3e, 0x0a, 0x1d, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, - 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x47, 0x49, 0x4e, 0x47, - 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4d, 0x4d, - 0x49, 0x54, 0x10, 0x01, 0x2a, 0x35, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, - 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x01, 0x12, - 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x44, 0x10, 0x02, 0x42, 0x26, 0x5a, 0x24, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, - 0x72, 0x73, 0x65, 0x2f, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x61, 0x76, 0x65, - 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x42, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x54, 0x6f, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x1d, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x54, + 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, + 0x8e, 0x01, 0x0a, 0x22, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, + 0x6e, 0x54, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x52, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, + 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, + 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, + 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x53, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x92, 0x02, 0x0a, 0x10, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, + 0x6d, 0x65, 0x74, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, + 0x40, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, + 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xa1, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x54, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x69, 0x6f, 0x2e, + 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, + 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3b, + 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc5, 0x03, 0x0a, 0x0f, + 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x47, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2f, 0x2e, 0x69, 0x6f, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x6c, + 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x50, + 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x2d, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6c, 0x6f, + 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x5f, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x2a, 0x2e, 0x0a, 0x0f, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, + 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, + 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x49, 0x4f, + 0x4e, 0x10, 0x01, 0x2a, 0x3e, 0x0a, 0x1d, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, + 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x47, 0x49, 0x4e, 0x47, 0x5f, + 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4d, 0x4d, 0x49, + 0x54, 0x10, 0x01, 0x2a, 0x35, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, + 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x44, 0x10, 0x02, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, + 0x73, 0x65, 0x2f, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x61, 0x76, 0x65, 0x6c, + 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/graveler/graveler.proto b/pkg/graveler/graveler.proto index 7f48453bf50..54cfbaaf35a 100644 --- a/pkg/graveler/graveler.proto +++ b/pkg/graveler/graveler.proto @@ -18,6 +18,7 @@ message RepositoryData { RepositoryState state = 5; string instance_uid = 6; bool read_only = 7; + string storage_id = 8; } message BranchData { diff --git a/pkg/graveler/mock/graveler.go b/pkg/graveler/mock/graveler.go index 2998afe71a7..61c7523eac4 100644 --- a/pkg/graveler/mock/graveler.go +++ b/pkg/graveler/mock/graveler.go @@ -276,18 +276,18 @@ func (mr *MockVersionControllerMockRecorder) Compare(ctx, repository, left, righ } // CreateBareRepository mocks base method. -func (m *MockVersionController) CreateBareRepository(ctx context.Context, repositoryID graveler.RepositoryID, storageNamespace graveler.StorageNamespace, defaultBranchID graveler.BranchID, readOnly bool) (*graveler.RepositoryRecord, error) { +func (m *MockVersionController) CreateBareRepository(ctx context.Context, repositoryID graveler.RepositoryID, storageID graveler.StorageID, storageNamespace graveler.StorageNamespace, defaultBranchID graveler.BranchID, readOnly bool) (*graveler.RepositoryRecord, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateBareRepository", ctx, repositoryID, storageNamespace, defaultBranchID, readOnly) + ret := m.ctrl.Call(m, "CreateBareRepository", ctx, repositoryID, storageID, storageNamespace, defaultBranchID, readOnly) ret0, _ := ret[0].(*graveler.RepositoryRecord) ret1, _ := ret[1].(error) return ret0, ret1 } // CreateBareRepository indicates an expected call of CreateBareRepository. -func (mr *MockVersionControllerMockRecorder) CreateBareRepository(ctx, repositoryID, storageNamespace, defaultBranchID, readOnly interface{}) *gomock.Call { +func (mr *MockVersionControllerMockRecorder) CreateBareRepository(ctx, repositoryID, storageID, storageNamespace, defaultBranchID, readOnly interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBareRepository", reflect.TypeOf((*MockVersionController)(nil).CreateBareRepository), ctx, repositoryID, storageNamespace, defaultBranchID, readOnly) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBareRepository", reflect.TypeOf((*MockVersionController)(nil).CreateBareRepository), ctx, repositoryID, storageID, storageNamespace, defaultBranchID, readOnly) } // CreateBranch mocks base method. @@ -330,18 +330,18 @@ func (mr *MockVersionControllerMockRecorder) CreateCommitRecord(ctx, repository, } // CreateRepository mocks base method. -func (m *MockVersionController) CreateRepository(ctx context.Context, repositoryID graveler.RepositoryID, storageNamespace graveler.StorageNamespace, branchID graveler.BranchID, readOnly bool) (*graveler.RepositoryRecord, error) { +func (m *MockVersionController) CreateRepository(ctx context.Context, repositoryID graveler.RepositoryID, storageID graveler.StorageID, storageNamespace graveler.StorageNamespace, branchID graveler.BranchID, readOnly bool) (*graveler.RepositoryRecord, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateRepository", ctx, repositoryID, storageNamespace, branchID, readOnly) + ret := m.ctrl.Call(m, "CreateRepository", ctx, repositoryID, storageID, storageNamespace, branchID, readOnly) ret0, _ := ret[0].(*graveler.RepositoryRecord) ret1, _ := ret[1].(error) return ret0, ret1 } // CreateRepository indicates an expected call of CreateRepository. -func (mr *MockVersionControllerMockRecorder) CreateRepository(ctx, repositoryID, storageNamespace, branchID, readOnly interface{}) *gomock.Call { +func (mr *MockVersionControllerMockRecorder) CreateRepository(ctx, repositoryID, storageID, storageNamespace, branchID, readOnly interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRepository", reflect.TypeOf((*MockVersionController)(nil).CreateRepository), ctx, repositoryID, storageNamespace, branchID, readOnly) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRepository", reflect.TypeOf((*MockVersionController)(nil).CreateRepository), ctx, repositoryID, storageID, storageNamespace, branchID, readOnly) } // CreateTag mocks base method. diff --git a/pkg/graveler/model.go b/pkg/graveler/model.go index e3977aea54c..32d78f5a43a 100644 --- a/pkg/graveler/model.go +++ b/pkg/graveler/model.go @@ -118,6 +118,7 @@ func RepoFromProto(pb *RepositoryData) *RepositoryRecord { return &RepositoryRecord{ RepositoryID: RepositoryID(pb.Id), Repository: &Repository{ + StorageID: StorageID(pb.StorageId), StorageNamespace: StorageNamespace(pb.StorageNamespace), DefaultBranchID: BranchID(pb.DefaultBranchId), CreationDate: pb.CreationDate.AsTime(), @@ -131,6 +132,7 @@ func RepoFromProto(pb *RepositoryData) *RepositoryRecord { func ProtoFromRepo(repo *RepositoryRecord) *RepositoryData { return &RepositoryData{ Id: repo.RepositoryID.String(), + StorageId: repo.Repository.StorageID.String(), StorageNamespace: repo.Repository.StorageNamespace.String(), DefaultBranchId: repo.Repository.DefaultBranchID.String(), CreationDate: timestamppb.New(repo.Repository.CreationDate),