From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: pdm-devel@lists.proxmox.com
Subject: Re: [PATCH datacenter-manager v3 04/12] subscription: api: add key pool and node status endpoints
Date: Fri, 15 May 2026 17:21:04 +0200 [thread overview]
Message-ID: <177885846422.344453.220557680274603474.b4-review@b4> (raw)
In-Reply-To: <20260515074623.766766-5-t.lamprecht@proxmox.com>
On Fri, 15 May 2026 09:43:14 +0200, Thomas Lamprecht <t.lamprecht@proxmox.com> wrote:
> diff --git a/server/src/api/subscriptions/mod.rs b/server/src/api/subscriptions/mod.rs
> new file mode 100644
> index 0000000..aa3146e
> --- /dev/null
> +++ b/server/src/api/subscriptions/mod.rs
> @@ -0,0 +1,1542 @@
> [ ... skip 210 lines ... ]
> + // loop on the first collision. The all-or-nothing contract holds because save_config
> + // only runs after the loop completes, so a bail on entry N leaves the on-disk pool
> + // untouched even if entries 1..N already landed in the in-memory `config`.
> + for entry in entries {
> + let key = entry.key.clone();
> + if let Some(existing) = config.insert(key.clone(), entry) {
^ This clone can be skipped, since you use the key from `existing` for
the error message.
> [ ... skip 34 lines ... ]
> + let (config, digest) = pdm_config::subscriptions::config()?;
> + rpcenv["digest"] = digest.to_hex().into();
> + let mut entry = config
> + .get(&key)
> + .cloned()
> + .ok_or_else(|| http_err!(NOT_FOUND, "key '{key}' not found in pool"))?;
We could put the `http_err!()` call into a reusable closure so we also
only have a single instance of the message text, to make it more
difficult for future patches to accidentally only change 1 of them.
--
next prev parent reply other threads:[~2026-05-15 15:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 7:43 [PATCH datacenter-manager v3 00/12] subscription key pool registry Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 01/12] api types: subscription level: render full names Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 02/12] pdm-client: add wait_for_local_task helper Thomas Lamprecht
2026-05-15 15:21 ` Wolfgang Bumiller
2026-05-15 7:43 ` [PATCH datacenter-manager v3 03/12] subscription: pool: add data model and config layer Thomas Lamprecht
2026-05-15 15:21 ` Wolfgang Bumiller
2026-05-15 7:43 ` [PATCH datacenter-manager v3 04/12] subscription: api: add key pool and node status endpoints Thomas Lamprecht
2026-05-15 15:21 ` Wolfgang Bumiller [this message]
2026-05-15 7:43 ` [PATCH datacenter-manager v3 05/12] ui: registry: add view with key pool and node status Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 06/12] cli: client: add subscription key pool management subcommands Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 07/12] docs: add subscription registry chapter Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 08/12] subscription: add Clear Key action and per-node revert Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 09/12] subscription: add Adopt Key action for foreign live subscriptions Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 10/12] subscription: add Adopt All bulk action Thomas Lamprecht
2026-05-15 7:43 ` [PATCH datacenter-manager v3 11/12] subscription: add Check Subscription action Thomas Lamprecht
2026-05-15 7:43 ` [RFC PATCH datacenter-manager v3 12/12] ui: registry: add Add-and-Assign wizard from Assign Key dialog 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=177885846422.344453.220557680274603474.b4-review@b4 \
--to=w.bumiller@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
--cc=t.lamprecht@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