mirror of
git://git.proxmox.com/git/pve-network.git
synced 2025-04-30 19:27:11 +02:00
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>
This commit is contained in:
parent
3551b612e9
commit
7c5b0f6daf
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,11 @@ 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) {
|
||||
if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) {
|
||||
return undef if $noerr;
|
||||
die "SDN object vnet ID '$id' contains illegal characters\n";
|
||||
die "vnet ID '$id' contains illegal characters\n";
|
||||
}
|
||||
die "vnet ID '$id' can't be more length than 10 characters\n" if length($id) > 10;
|
||||
return $id;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,11 @@ 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) {
|
||||
if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) {
|
||||
return undef if $noerr;
|
||||
die "SDN zone object ID '$id' contains illegal characters\n";
|
||||
die "zone ID '$id' contains illegal characters\n";
|
||||
}
|
||||
die "zone ID '$id' can't be more length than 10 characters\n" if length($id) > 10;
|
||||
return $id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue