]> git.proxmox.com Git - pve-network.git/commitdiff
controllers: allow minus and underscore in IDs again
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Feb 2022 10:19:43 +0000 (11:19 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Feb 2022 10:21:07 +0000 (11:21 +0100)
commit 7c5b0f6 not only reduced the possible length but also the
accepted character set, revert the latter partially again and allow
using minus and underscore for characters not being the start or end.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Network/SDN/Controllers/Plugin.pm

index 639cacafe2278276e243686c3410fa1bb8f28bcb..c1c2cfd2e0a7d3dfc734536cef0817a98309f1a5 100644 (file)
@@ -25,7 +25,7 @@ PVE::JSONSchema::register_format('pve-sdn-controller-id', \&parse_sdn_controller
 sub parse_sdn_controller_id {
     my ($id, $noerr) = @_;
 
-    if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) {
+    if ($id !~ m/^[a-z][a-z0-9_-]*[a-z0-9]$/i) {
         return undef if $noerr;
         die "controller ID '$id' contains illegal characters\n";
     }