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 78B4A1FF13F for ; Thu, 12 Mar 2026 09:43:47 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 876B69E2D; Thu, 12 Mar 2026 09:43:42 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 12 Mar 2026 09:43:38 +0100 Message-Id: To: "Thomas Lamprecht" , Subject: Re: applied: [PATCH ha-manager 0/2] fix #7399: check if required rule props are set From: "Daniel Kral" X-Mailer: aerc 0.21.0-38-g7088c3642f2c-dirty References: <20260311125008.271334-1-d.kral@proxmox.com> <177324873128.3691844.8082191608142351429.b4-ty@proxmox.com> In-Reply-To: <177324873128.3691844.8082191608142351429.b4-ty@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773304982552 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.041 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_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: P5O2VUDYDMU45QRNYI7DALR4UFHHJAPU X-Message-ID-Hash: P5O2VUDYDMU45QRNYI7DALR4UFHHJAPU X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed Mar 11, 2026 at 6:06 PM CET, Thomas Lamprecht wrote: > On Wed, 11 Mar 2026 13:49:34 +0100, Daniel Kral wrote: >> The API endpoints allow users to set empty 'nodes' and 'resources' >> properties for HA rules, which are not handled by the api schema >> verification nor the api handlers themselves. >>=20 >> PATCH 1 fixes the >>=20 >> got unexpected error - cannot lookup undefined type! at >> /usr/share/perl5/PVE/HA/Config.pm line 232. >>=20 >> [...] > > Applied, thanks. > > Tiny nit: A short hint in 1/2 that not guarding the result of > $class->lookup($rule->{type}) anymore is fine, as lookup dies > anyway if the plugin cannot be found would have been nice here, > but just a detail. Good point, the helper does rely on the fact that we don't allow unknown section types in the rules config and therefore $rule and $rule->{type} not being set, but still existent in $rules->{ids}. I'll keep that in mind in the future and address this in a patch series which should reduce the amount of die's in the Manager.pm to only the debug assertions! > > [1/2] rules: ensure rule is defined and has type in set_rule_defaults > commit: 00a71f147a203d15e952ca016c188e3e8a0cb518 > [2/2] api: rules: check for non-empty nodes and resources properties > commit: 41603823b12cdc10bb6041b002544795ddd0f91b