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 6DB2E1FF13E for ; Fri, 06 Feb 2026 17:12:53 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BE37DA541; Fri, 6 Feb 2026 17:13:14 +0100 (CET) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v2 2/2] sdn: Remove unneeded registered formats Date: Fri, 6 Feb 2026 17:12:34 +0100 Message-ID: <20260206161236.335026-4-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260206161236.335026-1-a.bied-charreton@proxmox.com> References: <20260206161236.335026-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -1.516 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods 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. RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLACK 3 Contains an URL listed in the URIBL blacklist [plugin.pm] Message-ID-Hash: HRXRYOPYUJG4MX366SUNLUWVN2D4UV4P X-Message-ID-Hash: HRXRYOPYUJG4MX366SUNLUWVN2D4UV4P X-MailFrom: abied-charreton@jett.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: Simple ID format verifications like length constraints and patterns have been moved to the schema definitions. Remove the now redundant custom verification code, iff no other code depends on the registered format. Signed-off-by: Arthur Bied-Charreton --- src/PVE/Network/SDN/Controllers/Plugin.pm | 14 -------------- src/PVE/Network/SDN/Dns/Plugin.pm | 13 ------------- src/PVE/Network/SDN/Ipams/Plugin.pm | 13 ------------- src/PVE/Network/SDN/VnetPlugin.pm | 14 -------------- src/PVE/Network/SDN/Zones/Plugin.pm | 14 -------------- 5 files changed, 68 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/Plugin.pm b/src/PVE/Network/SDN/Controllers/Plugin.pm index 73eaa0b..0a6e4e8 100644 --- a/src/PVE/Network/SDN/Controllers/Plugin.pm +++ b/src/PVE/Network/SDN/Controllers/Plugin.pm @@ -21,26 +21,12 @@ PVE::JSONSchema::register_standard_option( { description => "The SDN controller object identifier.", type => 'string', - format => 'pve-sdn-controller-id', minLength => 2, maxLength => 64, pattern => '[a-zA-Z][a-zA-Z0-9_-]*[a-zA-Z0-9]', }, ); -PVE::JSONSchema::register_format('pve-sdn-controller-id', \&parse_sdn_controller_id); - -sub parse_sdn_controller_id { - my ($id, $noerr) = @_; - - if ($id !~ m/^[a-z][a-z0-9_-]*[a-z0-9]$/i) { - return undef if $noerr; - die "controller ID '$id' contains illegal characters\n"; - } - die "controller ID '$id' can't be more length than 64 characters\n" if length($id) > 64; - return $id; -} - my $defaultData = { propertyList => { diff --git a/src/PVE/Network/SDN/Dns/Plugin.pm b/src/PVE/Network/SDN/Dns/Plugin.pm index 8e623ba..4fc15b2 100644 --- a/src/PVE/Network/SDN/Dns/Plugin.pm +++ b/src/PVE/Network/SDN/Dns/Plugin.pm @@ -23,24 +23,11 @@ PVE::JSONSchema::register_standard_option( { description => "The SDN dns object identifier.", type => 'string', - format => 'pve-sdn-dns-id', pattern => '[a-zA-Z][a-zA-Z0-9]*[a-zA-Z0-9]', minLength => 2, }, ); -PVE::JSONSchema::register_format('pve-sdn-dns-id', \&parse_sdn_dns_id); - -sub parse_sdn_dns_id { - my ($id, $noerr) = @_; - - if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) { - return undef if $noerr; - die "dns ID '$id' contains illegal characters\n"; - } - return $id; -} - my $defaultData = { propertyList => { diff --git a/src/PVE/Network/SDN/Ipams/Plugin.pm b/src/PVE/Network/SDN/Ipams/Plugin.pm index 422fbc8..26d0931 100644 --- a/src/PVE/Network/SDN/Ipams/Plugin.pm +++ b/src/PVE/Network/SDN/Ipams/Plugin.pm @@ -24,24 +24,11 @@ PVE::JSONSchema::register_standard_option( { description => "The SDN ipam object identifier.", type => 'string', - format => 'pve-sdn-ipam-id', pattern => '[a-zA-Z][a-zA-Z0-9]*[a-zA-Z0-9]', minLength => 2, }, ); -PVE::JSONSchema::register_format('pve-sdn-ipam-id', \&parse_sdn_ipam_id); - -sub parse_sdn_ipam_id { - my ($id, $noerr) = @_; - - if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) { - return undef if $noerr; - die "ipam ID '$id' contains illegal characters\n"; - } - return $id; -} - my $defaultData = { propertyList => { diff --git a/src/PVE/Network/SDN/VnetPlugin.pm b/src/PVE/Network/SDN/VnetPlugin.pm index 5ceb3a1..e041575 100644 --- a/src/PVE/Network/SDN/VnetPlugin.pm +++ b/src/PVE/Network/SDN/VnetPlugin.pm @@ -21,26 +21,12 @@ PVE::JSONSchema::register_standard_option( { description => "The SDN vnet object identifier.", type => 'string', - format => 'pve-sdn-vnet-id', pattern => '[a-zA-Z][a-zA-Z0-9]*[a-zA-Z0-9]', minLength => 2, maxLength => 8, }, ); -PVE::JSONSchema::register_format('pve-sdn-vnet-id', \&parse_sdn_vnet_id); - -sub parse_sdn_vnet_id { - my ($id, $noerr) = @_; - - if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) { - return undef if $noerr; - die "vnet ID '$id' contains illegal characters\n"; - } - die "vnet ID '$id' can't be more length than 8 characters\n" if length($id) > 8; - return $id; -} - my $defaultData = { propertyList => { diff --git a/src/PVE/Network/SDN/Zones/Plugin.pm b/src/PVE/Network/SDN/Zones/Plugin.pm index 2a02278..5d858af 100644 --- a/src/PVE/Network/SDN/Zones/Plugin.pm +++ b/src/PVE/Network/SDN/Zones/Plugin.pm @@ -23,26 +23,12 @@ PVE::JSONSchema::register_standard_option( { description => "The SDN zone object identifier.", type => 'string', - format => 'pve-sdn-zone-id', pattern => '[a-zA-Z][a-zA-Z0-9]*[a-zA-Z0-9]', minLength => 2, maxLength => 8, }, ); -PVE::JSONSchema::register_format('pve-sdn-zone-id', \&parse_sdn_zone_id); - -sub parse_sdn_zone_id { - my ($id, $noerr) = @_; - - if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) { - return undef if $noerr; - die "zone ID '$id' contains illegal characters\n"; - } - die "zone ID '$id' can't be more length than 8 characters\n" if length($id) > 8; - return $id; -} - my $defaultData = { propertyList => { -- 2.47.3