controllers: allow minus and underscore in IDs again

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>
This commit is contained in:
Thomas Lamprecht 2022-02-01 11:19:43 +01:00
parent 3f557f268d
commit f81ad67fc9

View 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";
}