summaryrefslogtreecommitdiff
path: root/PVE/Network/SDN/Controllers
diff options
context:
space:
mode:
authorAlexandre Derumier <aderumier@odiso.com>2019-11-26 10:00:27 +0100
committerThomas Lamprecht <t.lamprecht@proxmox.com>2019-11-26 12:33:40 +0100
commit7c5b0f6daf45c1491fe55dbb29c814925cad24bb (patch)
treefd2d1c7eaebae7fcaa914cffdc3447ad14db7036 /PVE/Network/SDN/Controllers
parent3551b612e9b7a8ac26f7392b1438fa33da9865eb (diff)
limit vnet/zones/controller to 10 characters
linux have 16 characters limit for interfaces, but we can prepend "vxlan", "vrf",... when we generate interfaces Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Diffstat (limited to 'PVE/Network/SDN/Controllers')
-rw-r--r--PVE/Network/SDN/Controllers/Plugin.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/PVE/Network/SDN/Controllers/Plugin.pm b/PVE/Network/SDN/Controllers/Plugin.pm
index df385f1..3aed73a 100644
--- a/PVE/Network/SDN/Controllers/Plugin.pm
+++ b/PVE/Network/SDN/Controllers/Plugin.pm
@@ -27,10 +27,11 @@ 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 "SDN controller object ID '$id' contains illegal characters\n";
+ die "controller ID '$id' contains illegal characters\n";
}
+ die "controller ID '$id' can't be more length than 10 characters\n" if length($id) > 10;
return $id;
}