schema: anchor regex for 'pve-storage-format'

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Acked-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fiona Ebner
2025-03-05 11:49:20 +01:00
committed by Thomas Lamprecht
parent bba0b3ae46
commit 1b38ad0e27

View File

@ -346,7 +346,7 @@ PVE::JSONSchema::register_format('pve-storage-format', \&verify_format);
sub verify_format { sub verify_format {
my ($fmt, $noerr) = @_; my ($fmt, $noerr) = @_;
if ($fmt !~ m/(raw|qcow2|vmdk|subvol)/) { if ($fmt !~ m/^(raw|qcow2|vmdk|subvol)$/) {
return undef if $noerr; return undef if $noerr;
die "invalid format '$fmt'\n"; die "invalid format '$fmt'\n";
} }