From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7EFF31FF17A for ; Tue, 9 Dec 2025 13:10:03 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 631C326DBC; Tue, 9 Dec 2025 13:10:42 +0100 (CET) Mime-Version: 1.0 Date: Tue, 09 Dec 2025 13:10:08 +0100 Message-Id: From: "Christoph Heiss" To: "Lukas Wagner" X-Mailer: aerc 0.21.0 References: <20251205112528.373387-1-c.heiss@proxmox.com> <20251205112528.373387-10-c.heiss@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1765282203181 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.052 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH datacenter-manager v2 09/14] config: add auto-installer configuration module X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Cc: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Thanks for the review! On Tue Dec 9, 2025 at 11:22 AM CET, Lukas Wagner wrote: > One note inline, otherwise this looks good to me. > > On Fri Dec 5, 2025 at 12:25 PM CET, Christoph Heiss wrote: [..] >> diff --git a/lib/pdm-config/src/auto_install.rs b/lib/pdm-config/src/auto_install.rs >> new file mode 100644 >> index 0000000..0374a70 >> --- /dev/null >> +++ b/lib/pdm-config/src/auto_install.rs >> @@ -0,0 +1,85 @@ >> +//! Implements configuration for the auto-installer integration. >> + >> +use anyhow::Result; >> +use proxmox_schema::ApiType; >> +use proxmox_section_config::{SectionConfig, SectionConfigData, SectionConfigPlugin}; >> +use std::{fs::File, sync::LazyLock}; >> + >> +use pdm_api_types::{ >> + auto_installer::{Installation, PreparedInstallationConfig, PREPARED_INSTALL_CONFIG_ID_SCHEMA}, >> + ConfigDigest, >> +}; >> +use proxmox_product_config::{open_api_lockfile, replace_config, ApiLockGuard}; >> +use proxmox_sys::error::SysError; >> + >> +pub const CONFIG_PATH: &str = pdm_buildcfg::configdir!("/autoinst"); >> + >> +static CONFIG: LazyLock = LazyLock::new(|| { >> + let mut config = SectionConfig::new(&PREPARED_INSTALL_CONFIG_ID_SCHEMA); >> + >> + config.register_plugin(SectionConfigPlugin::new( >> + "prepared-answer".into(), >> + Some("id".into()), >> + PreparedInstallationConfig::API_SCHEMA.unwrap_object_schema(), >> + )); >> + config >> +}); >> + >> +const PREPARED_CONF_FILE: &str = pdm_buildcfg::configdir!("/autoinst/prepared.cfg"); >> +const PREPARED_LOCK_FILE: &str = pdm_buildcfg::configdir!("/autoinst/.prepared.lock"); >> + >> +// Information about installations themselves are not configuration files and thus are saved >> +// as JSON. >> +const INSTALLATIONS_CONF_FILE: &str = pdm_buildcfg::configdir!("/autoinst/installations.json"); >> +const INSTALLATIONS_LOCK_FILE: &str = pdm_buildcfg::configdir!("/autoinst/.installations.lock"); > > Any particular reason why you put `installations.json` in the config > directory and not in /var/lib/proxmox-datacenter-manager/... as 'state'? > To me this more seems like application state rather than configuration. Good point, they should definitely live there! I'll change it for v2. Honestly, I just wasn't aware that we already have and use /var/lib/proxmox-datacenter-manager :^) _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel