From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E14001FF183 for ; Wed, 30 Jul 2025 20:01:50 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 813F617537; Wed, 30 Jul 2025 20:00:47 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Wed, 30 Jul 2025 19:59:49 +0200 Message-ID: <20250730175957.386674-23-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250730175957.386674-1-d.kral@proxmox.com> References: <20250730175957.386674-1-d.kral@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753898389527 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.014 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [RFC ha-manager v5 22/23] api: resources: disallow group prop in modifying endpoints if migrated X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Disallow creating or updating HA resources through the HA resource API as soon as the HA groups have been fully migrated (i.e. no entries or deleted), because HA groups are deprecated and new users are pushed to not use them anymore. Signed-off-by: Daniel Kral --- should we die here? src/PVE/API2/HA/Resources.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PVE/API2/HA/Resources.pm b/src/PVE/API2/HA/Resources.pm index cdd62ec9..05848f51 100644 --- a/src/PVE/API2/HA/Resources.pm +++ b/src/PVE/API2/HA/Resources.pm @@ -195,6 +195,9 @@ __PACKAGE__->register_method({ die "types does not match\n" if $param_type ne $type; } + die "invalid parameter 'group': ha groups have been migrated to rules\n" + if defined($param->{group}) && PVE::HA::Config::have_groups_been_migrated(); + my $plugin = PVE::HA::Resources->lookup($type); $plugin->verify_name($name); @@ -250,6 +253,9 @@ __PACKAGE__->register_method({ if (my $group = $param->{group}) { my $group_cfg = PVE::HA::Config::read_group_config(); + die "invalid parameter 'group': ha groups have been migrated to rules\n" + if PVE::HA::Config::have_groups_been_migrated($group_cfg); + die "HA group '$group' does not exist\n" if !$group_cfg->{ids}->{$group}; } -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel