[pbs-devel] [PATCH proxmox-backup 4/8] api: datastore: conditional lookup for catalog endpoint

Christian Ebner c.ebner at proxmox.com
Fri Jun 7 12:34:27 CEST 2024


On 6/7/24 12:23, Fabian Grünbichler wrote:
> On June 7, 2024 11:43 am, Christian Ebner wrote:
>> Add an optional `archive-name` parameter, indicating the metadata
>> archive to be used for directory content lookups instead of the
>> catalog. If provided, instead of the catalog reader, a pxar Accessor
>> instance is created to perform the lookup.
>>
>> This is in preparation for dropping catalog encoding for snapshots
>> with split pxar archive encoding.
>>
>> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
>> ---
>>   src/api2/admin/datastore.rs | 73 ++++++++++++++++++++++++++++---------
>>   1 file changed, 55 insertions(+), 18 deletions(-)
>>
>> diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
>> index 117dab080..e25a78bca 100644
>> --- a/src/api2/admin/datastore.rs
>> +++ b/src/api2/admin/datastore.rs
>> @@ -1659,7 +1659,12 @@ fn decode_path(path: &str) -> Result<Vec<u8>, Error> {
>>               "filepath": {
>>                   description: "Base64 encoded path.",
>>                   type: String,
>> -            }
>> +            },
>> +            "archive-name": {
>> +                type: String,
>> +                description: "Name of the archive to lookup given filepath (base64 encoded)",
>> +                optional: true,
>> +            },
> 
> why is this base64 encoded? the archive name is a safe ID..

My intention here was to be sure that I did not overlooked a edge case 
for the archive name and be consistent with the current filepath.

But you are right, will adapt this in a new version of the patch series.





More information about the pbs-devel mailing list