From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id B5EDF1FF0AF for ; Thu, 08 Oct 2026 15:06:12 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C50F421514; Thu, 08 Oct 2026 15:06:05 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 08 Oct 2026 15:06:00 +0200 Message-Id: To: =?utf-8?q?Michael_K=C3=B6ppl?= , "Lukas Wagner" , , Subject: Re: [PATCH proxmox v2 15/34] notify: migrate PBS's and PVE's default matcher to expression syntax From: "Lukas Wagner" X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20261001083706.144246-1-l.wagner@proxmox.com> <20261001083706.144246-16-l.wagner@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791464761008 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.354 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: 3GPEMG7LZFMR73RPKLBXRKJM6P74NCYI X-Message-ID-Hash: 3GPEMG7LZFMR73RPKLBXRKJM6P74NCYI X-MailFrom: l.wagner@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 Oct 7, 2026 at 11:32 AM CEST, Michael K=C3=B6ppl wrote: > On Thu Oct 1, 2026 at 10:36 AM CEST, Lukas Wagner wrote: > > [snip] > >> + >> + let expr: Expression =3D Expression::C= onstant(true); >> + >> + let expr_str =3D serde_json::to_string(&expr) >> + .expect("failed serialize expression for 'default-match= er'"); >> + >> + config >> + .set_data( >> + "default-matcher", >> + MATCHER_TYPENAME, >> + MatcherConfig { >> + name: "default-matcher".into(), >> + expression: Some(expr_str), > > If at least one of the nodes in a cluster is already upgraded and for > ANY reason persists to /etc/pve/notifications.cfg, any node that is > not upgraded will not be able to send any notifications at all until it > is also upgraded, since it fails to parse this. > > IMO it's not really a problem since cluster nodes should be upgraded to > the same version anyway, but wanted to point out that it might be worth > highlighting to users when including this in a release, since this will > stop nodes from sending notifications even if the new expressions are > never used. Simply editing a target is enough to cause this. > Good catch! After some discussions with you and Fiona (thanks a ton to both of you), I've decided that the simplest option is to include a check in the POST/PUT handlers for matchers - if 'expression' is set, we do a version check to ensure that all (online) cluster nodes are recent enough. It's not a perfect solution, but avoids creating a config that would fail to parse on outdated nodes, leading to a failure to send notifications. We can probably drop this check at the next major version. >> + target: vec!["mail-to-root".into()], >> + comment: Some("Route all notifications to mail-= to-root".into()), >> + ..Default::default() >> + }, >> + ) >> + .expect("failed to set 'default-matcher' in default con= fig"); >> + >> + config >> + }) > > [snip]