From: Hannes Laimer <h.laimer@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>, pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox v4 2/8] pbs-api-types: move over NodeConfig and related api type from PBS
Date: Tue, 31 Mar 2026 13:17:11 +0200 [thread overview]
Message-ID: <aba75547-56d0-442c-b534-a107cca4f92d@proxmox.com> (raw)
In-Reply-To: <20260327121319.628881-3-c.ebner@proxmox.com>
On 2026-03-27 13:12, Christian Ebner wrote:
> In preparation for refactoring the node config in PBS.
>
> In order to move over the code, the previously used
> proxmox_backup::tools::config::from_property_string()
> helpers are replaced by analogous implementations by inlining the
> serde_json::from_value() calls.
>
> Further, the NodeConfig::validate() was only used by the node's
> save_config() implementation and has therefore been inlined on the
> PBS side to avoid a dependency on openssl crate.
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
[..]
> +impl Iterator for AcmeDomainIter<'_> {
> + type Item = Result<AcmeDomain, Error>;
> +
> + fn next(&mut self) -> Option<Self::Item> {
> + let domain = loop {
> + let index = self.index;
> + self.index += 1;
> +
> + let domain = match index {
> + 0 => self.config.acmedomain0.as_deref(),
> + 1 => self.config.acmedomain1.as_deref(),
> + 2 => self.config.acmedomain2.as_deref(),
> + 3 => self.config.acmedomain3.as_deref(),
> + 4 => self.config.acmedomain4.as_deref(),
> + _ => return None,
> + };
> +
> + if let Some(domain) = domain {
> + break domain;
> + }
> + };
> +
> + Some(
> + AcmeDomain::API_SCHEMA
> + .parse_property_string(domain)
> + .and_then(|domain| Ok(serde_json::from_value(domain)?)),
the `?` is only for error conversion, an explicit
```
- .and_then(|domain| Ok(serde_json::from_value(domain)?)),
+ .and_then(|value| {
+ serde_json::from_value(value).map_err(|err|
err.into())
+ }),
```
might be better. either way, very nit and very minor
> + )
> + }
> +}
next prev parent reply other threads:[~2026-03-31 11:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 12:13 [PATCH proxmox{,-backup} v4 0/8] fix #6716: Add support for http proxy configuration for S3 endpoints Christian Ebner
2026-03-27 12:13 ` [PATCH proxmox v4 1/8] http: move http proxy schema from PBS to crate's api types Christian Ebner
2026-03-27 12:13 ` [PATCH proxmox v4 2/8] pbs-api-types: move over NodeConfig and related api type from PBS Christian Ebner
2026-03-31 11:17 ` Hannes Laimer [this message]
2026-03-27 12:13 ` [PATCH proxmox-backup v4 3/8] pbs-config: use http proxy schema moved to proxmox-http crate Christian Ebner
2026-03-27 12:13 ` [PATCH proxmox-backup v4 4/8] config: inline NodeConfig::validate() to its only call side Christian Ebner
2026-03-27 12:13 ` [PATCH proxmox-backup v4 5/8] config: use moved NodeConfig definitions in pbs-api-types Christian Ebner
2026-03-27 12:13 ` [PATCH proxmox-backup v4 6/8] tools: drop unused from_property_string() helper Christian Ebner
2026-03-27 12:13 ` [PATCH proxmox-backup v4 7/8] config: move node config into pbs-config, including helper tools Christian Ebner
2026-03-27 12:13 ` [PATCH proxmox-backup v4 8/8] fix #6716: pass node http proxy config to s3 backend Christian Ebner
2026-03-31 11:18 ` [PATCH proxmox{,-backup} v4 0/8] fix #6716: Add support for http proxy configuration for S3 endpoints Hannes Laimer
2026-03-31 21:30 ` partially-applied: " 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=aba75547-56d0-442c-b534-a107cca4f92d@proxmox.com \
--to=h.laimer@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