all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] sync: push: use min version helper for api compatibility checks
Date: Thu, 28 Nov 2024 13:49:25 +0100	[thread overview]
Message-ID: <20241128124925.318298-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20241128124925.318298-1-c.ebner@proxmox.com>

Use the compatibility check helper to reduce possible errors when
comparing api version.

No functional change intended.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 src/server/push.rs | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/server/push.rs b/src/server/push.rs
index 95c7c6bff..957eb1ab2 100644
--- a/src/server/push.rs
+++ b/src/server/push.rs
@@ -129,13 +129,12 @@ impl PushParameters {
         let api_version = ApiVersion::try_from(version_info)?;
 
         // push assumes namespace support on the remote side, fail early if missing
-        if api_version.major < 2 || (api_version.major == 2 && api_version.minor < 2) {
+        if !api_version.is_min_required(ApiVersion::new(2, 2, 0, String::new())) {
             bail!("Unsupported remote api version, minimum v2.2 required");
         }
 
-        let supports_prune_delete_stats = api_version.major > 3
-            || (api_version.major == 3 && api_version.minor >= 3)
-            || (api_version.major == 3 && api_version.minor == 2 && api_version.release >= 11);
+        let supports_prune_delete_stats =
+            api_version.is_min_required(ApiVersion::new(3, 2, 11, String::new()));
 
         let target = PushTarget {
             remote,
-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  reply	other threads:[~2024-11-28 12:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 12:49 [pbs-devel] [PATCH proxmox-backup 1/2] api types: version: add helper for min version checks Christian Ebner
2024-11-28 12:49 ` Christian Ebner [this message]
2024-11-28 13:10 ` Thomas Lamprecht
2024-11-28 13:14   ` Christian Ebner
2024-11-28 13:18     ` Thomas Lamprecht
2024-11-28 13:49       ` Christian Ebner
2024-11-28 13:50         ` Thomas Lamprecht
2024-11-28 16:09 ` 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=20241128124925.318298-2-c.ebner@proxmox.com \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal