[pbs-devel] [PATCH v2 proxmox-backup 4/6] fix #6072: server: sync encrypted or verified snapshots only

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Apr 2 16:11:12 CEST 2025


Am 02.04.25 um 15:57 schrieb Christian Ebner:
> On 4/2/25 15:29, Thomas Lamprecht wrote:
>> Am 18.03.25 um 12:39 schrieb Christian Ebner:
>>> @@ -402,6 +403,55 @@ async fn pull_snapshot<'a>(
>>>   
>>>       let manifest = BackupManifest::try_from(tmp_manifest_blob)?;
>>>   
>>> +    if params.verified_only {
>>> +        let mut snapshot_verified = false;
>>> +        if let Ok(Some(verify_state)) = manifest.verify_state() {
>>> +            if let VerifyState::Ok = verify_state.state {
>>> +                snapshot_verified = true;
>>> +            }
>>> +        }
>> nit: IMO this would read slightly nicer as match, but no hard feelings.
>> E.g. like (untested):
>>
>> let snapshot_verified = match source_manifest.verify_state() {
>>      Ok(Some(VerifyState::Ok)) => true,
>>      _ => false,
>> };
> While that reads much nicer, destructuring does not work as the actual 
> verify state is stored within the `verify_state.state`. The alternative 
> would be to use a match guard, but that might be more confusing?

Oh, right. Yeah that is not nice, and some more involved like doing an
.ok().flatten() for the result and then .map()'ing that is also not
really nice.

Maybe it would be better to add an is_verified() -> Result<bool, Error>
function added to manifest impl instead; but does not have to be part
of this series and I did not think that really through, just an idea.




More information about the pbs-devel mailing list