From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>,
Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH v2 proxmox-backup 4/6] fix #6072: server: sync encrypted or verified snapshots only
Date: Wed, 2 Apr 2025 16:11:12 +0200 [thread overview]
Message-ID: <afe71034-8b1f-4824-8359-b4787883e5b4@proxmox.com> (raw)
In-Reply-To: <3de5cc1a-f27b-4ae8-bdd5-544782c5d5a0@proxmox.com>
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.
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-04-02 14:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 11:39 [pbs-devel] [PATCH v2 proxmox proxmox-backup 0/6] fix #6072: sync encrypted/verified " Christian Ebner
2025-03-18 11:39 ` [pbs-devel] [PATCH v2 proxmox 1/6] pbs-api-types: sync: add sync encrypted/verified snapshots only flags Christian Ebner
2025-03-18 11:39 ` [pbs-devel] [PATCH v2 proxmox-backup 2/6] server: pull: refactor snapshot pull logic Christian Ebner
2025-04-02 13:54 ` [pbs-devel] applied: " Thomas Lamprecht
2025-03-18 11:39 ` [pbs-devel] [PATCH v2 proxmox-backup 3/6] api: sync: honor sync jobs encrypted/verified only flags Christian Ebner
2025-03-18 11:39 ` [pbs-devel] [PATCH v2 proxmox-backup 4/6] fix #6072: server: sync encrypted or verified snapshots only Christian Ebner
2025-04-02 13:29 ` Thomas Lamprecht
2025-04-02 13:57 ` Christian Ebner
2025-04-02 14:11 ` Thomas Lamprecht [this message]
2025-03-18 11:39 ` [pbs-devel] [PATCH v2 proxmox-backup 5/6] bin: manager: expose encrypted/verified only flags for cli Christian Ebner
2025-03-18 11:39 ` [pbs-devel] [PATCH v2 proxmox-backup 6/6] www: expose encrypted/verified only flags in the sync job edit Christian Ebner
2025-04-02 15:30 ` [pbs-devel] superseded: [PATCH v2 proxmox proxmox-backup 0/6] fix #6072: sync encrypted/verified snapshots only Christian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afe71034-8b1f-4824-8359-b4787883e5b4@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=c.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal