public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Sterz <s.sterz@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-offline-mirror v2 2/2] add support for bookworm enterprise ceph repo
Date: Mon, 12 Jun 2023 15:37:15 +0200	[thread overview]
Message-ID: <20230612133715.453237-3-s.sterz@proxmox.com> (raw)
In-Reply-To: <20230612133715.453237-1-s.sterz@proxmox.com>

the bookworm release of proxmox ve comes along with a new ceph
enterprise repo. this commit adds support for this new repo for
bookworm-based releases.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
---
 src/bin/proxmox-offline-mirror.rs | 37 ++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs
index e2282d7..f5be2c0 100644
--- a/src/bin/proxmox-offline-mirror.rs
+++ b/src/bin/proxmox-offline-mirror.rs
@@ -1,4 +1,5 @@
 use std::fmt::Display;
+use std::matches;
 use std::path::Path;
 
 use anyhow::{bail, format_err, Error};
@@ -274,8 +275,36 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                     Some(releases.len() - 1),
                 )?;
 
-                let components =
-                    read_string_from_tty("Enter repository components", Some("main test"))?;
+                let (base_url, components) = if matches!(release, Release::Bookworm) {
+                    let variants = &[
+                        (ProxmoxVariant::Enterprise, "Enterprise repository"),
+                        (ProxmoxVariant::NoSubscription, "No-Subscription repository"),
+                        (ProxmoxVariant::Test, "Test repository"),
+                    ];
+
+                    let variant =
+                        read_selection_from_tty("Select repository variant", variants, Some(0))?;
+
+                    match variant {
+                        ProxmoxVariant::Enterprise => (
+                            "https://enterprise.proxmox.com/debian/ceph",
+                            "enterprise".to_string(),
+                        ),
+                        ProxmoxVariant::NoSubscription => (
+                            "http://download.proxmox.com/debian/ceph",
+                            "no-subscription".to_string(),
+                        ),
+                        ProxmoxVariant::Test => (
+                            "http://download.proxmox.com/debian/ceph",
+                            "test".to_string(),
+                        ),
+                    }
+                } else {
+                    (
+                        "http://download.proxmox.com/debian/ceph",
+                        read_string_from_tty("Enter repository components", Some("main test"))?,
+                    )
+                };
 
                 let key = match release {
                     Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg",
@@ -291,9 +320,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                     CephRelease::Quincy => "quincy",
                 };
 
-                let url = format!(
-                    "http://download.proxmox.com/debian/ceph-{ceph_release} {release} {components}"
-                );
+                let url = format!("{base_url}-{ceph_release} {release} {components}");
                 let suggested_id = format!("ceph_{ceph_release}_{release}");
 
                 (url, key.to_string(), suggested_id, SkipConfig::default())
-- 
2.30.2





  parent reply	other threads:[~2023-06-12 13:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 13:37 [pbs-devel] [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Stefan Sterz
2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 1/2] add bookworm to the list of releases Stefan Sterz
2023-06-12 13:37 ` Stefan Sterz [this message]
2023-06-16  8:05 ` [pbs-devel] applied-series: [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Thomas Lamprecht

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=20230612133715.453237-3-s.sterz@proxmox.com \
    --to=s.sterz@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