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 77D471FF183 for ; Wed, 30 Jul 2025 19:59:50 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0562116D74; Wed, 30 Jul 2025 20:00:16 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Wed, 30 Jul 2025 19:59:50 +0200 Message-ID: <20250730175957.386674-24-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: 1753898389533 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] [PATCH ha-manager v5 23/23] api: rules: disallow modifying api calls if ha groups not 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" Otherwise it is rather non-deterministic if the HA rules are actually applied as it depends whether the HA Manager is on one of the nodes, which have already been upgraded to the new version. Signed-off-by: Daniel Kral --- src/PVE/API2/HA/Rules.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PVE/API2/HA/Rules.pm b/src/PVE/API2/HA/Rules.pm index 62d05440..881f36f6 100644 --- a/src/PVE/API2/HA/Rules.pm +++ b/src/PVE/API2/HA/Rules.pm @@ -259,6 +259,9 @@ __PACKAGE__->register_method({ PVE::Cluster::check_cfs_quorum(); mkdir("/etc/pve/ha"); + die "cannot create ha rule: ha groups have not been migrated yet\n" + if !PVE::HA::Config::have_groups_been_migrated(); + my $type = extract_param($param, 'type'); my $ruleid = extract_param($param, 'rule'); @@ -305,6 +308,9 @@ __PACKAGE__->register_method({ code => sub { my ($param) = @_; + die "cannot update ha rule: ha groups have not been migrated yet\n" + if !PVE::HA::Config::have_groups_been_migrated(); + my $ruleid = extract_param($param, 'rule'); my $digest = extract_param($param, 'digest'); my $delete = extract_param($param, 'delete'); -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel