* [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action
@ 2026-05-12 13:43 Stefan Hanreich
2026-05-13 3:08 ` applied: " Thomas Lamprecht
2026-05-13 8:15 ` Fiona Ebner
0 siblings, 2 replies; 4+ messages in thread
From: Stefan Hanreich @ 2026-05-12 13:43 UTC (permalink / raw)
To: pve-devel
Add missing format_description to the value properties in match and
set property strings. Their exact format depends on the key set in the
property string.
The 2 keys that can have a value in the exit-action both refer to the
order number of a route map entry, so change the type to the
pre-defined route map order type. Order is a u16, so fix the maximum
value to match the maximum accepted value by FRR. This is wrong in
the JSON schema, but is correct in the section config type.
Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
Not sure about the format description for match and set. Maybe we
could do something like
`<route-type:ead|macip|multicast|es|prefix>|<vni:1-16777215>|..`
to indicate the exact format of value, depending on the key?
src/PVE/Network/SDN/RouteMaps.pm | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/PVE/Network/SDN/RouteMaps.pm b/src/PVE/Network/SDN/RouteMaps.pm
index 5560f180..b2bf9eda 100644
--- a/src/PVE/Network/SDN/RouteMaps.pm
+++ b/src/PVE/Network/SDN/RouteMaps.pm
@@ -48,7 +48,8 @@ our $ROUTE_MAP_MATCH_FORMAT = {
value => {
type => 'string',
optional => 1,
- description => 'value that should be matched on',
+ description => 'Value that the field <key> should be matched on.',
+ format_description => '<key-dependent>',
},
};
@@ -67,7 +68,7 @@ PVE::JSONSchema::register_standard_option(
description => 'The index of this route map entry',
type => 'integer',
minimum => 0,
- maximum => 2**32 - 1,
+ maximum => 65535,
},
);
@@ -164,7 +165,8 @@ sub route_map_properties {
value => {
type => 'string',
optional => 1,
- description => 'value that should be set to',
+ description => 'Value that the field <key> should be set to.',
+ format_description => '<key-dependent>',
},
},
},
@@ -187,11 +189,7 @@ sub route_map_properties {
'on-match-goto', 'on-match-next', 'continue',
],
},
- value => {
- type => 'string',
- optional => 1,
- description => 'type of exit action',
- },
+ value => get_standard_option('pve-sdn-route-map-order'),
},
optional => 1,
},
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* applied: [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action
2026-05-12 13:43 [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action Stefan Hanreich
@ 2026-05-13 3:08 ` Thomas Lamprecht
2026-05-13 8:15 ` Fiona Ebner
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2026-05-13 3:08 UTC (permalink / raw)
To: pve-devel, Stefan Hanreich
On Tue, 12 May 2026 15:43:34 +0200, Stefan Hanreich wrote:
> Add missing format_description to the value properties in match and
> set property strings. Their exact format depends on the key set in the
> property string.
>
> The 2 keys that can have a value in the exit-action both refer to the
> order number of a route map entry, so change the type to the
> pre-defined route map order type. Order is a u16, so fix the maximum
> value to match the maximum accepted value by FRR. This is wrong in
> the JSON schema, but is correct in the section config type.
>
> [...]
Applied, thanks!
[1/1] sdn: api: route maps: fix json schema for match, set and exit-action
commit: ba48fb02862e819552631c54b824541396a8dba6
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action
2026-05-12 13:43 [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action Stefan Hanreich
2026-05-13 3:08 ` applied: " Thomas Lamprecht
@ 2026-05-13 8:15 ` Fiona Ebner
2026-05-13 11:50 ` Stefan Hanreich
1 sibling, 1 reply; 4+ messages in thread
From: Fiona Ebner @ 2026-05-13 8:15 UTC (permalink / raw)
To: Stefan Hanreich, pve-devel
Am 12.05.26 um 3:41 PM schrieb Stefan Hanreich:
> The 2 keys that can have a value in the exit-action both refer to the
> order number of a route map entry, so change the type to the
> pre-defined route map order type.
---snip 8<---
> @@ -187,11 +189,7 @@ sub route_map_properties {
> 'on-match-goto', 'on-match-next', 'continue',
> ],
> },
> - value => {
> - type => 'string',
> - optional => 1,
> - description => 'type of exit action',
> - },
> + value => get_standard_option('pve-sdn-route-map-order'),
Don't we need an ', { optional => 1 }' here?
> },
> optional => 1,
> },
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action
2026-05-13 8:15 ` Fiona Ebner
@ 2026-05-13 11:50 ` Stefan Hanreich
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hanreich @ 2026-05-13 11:50 UTC (permalink / raw)
To: Fiona Ebner, pve-devel
On 5/13/26 10:13 AM, Fiona Ebner wrote:
> Am 12.05.26 um 3:41 PM schrieb Stefan Hanreich:
>> The 2 keys that can have a value in the exit-action both refer to the
>> order number of a route map entry, so change the type to the
>> pre-defined route map order type.
>
> ---snip 8<---
>
>> @@ -187,11 +189,7 @@ sub route_map_properties {
>> 'on-match-goto', 'on-match-next', 'continue',
>> ],
>> },
>> - value => {
>> - type => 'string',
>> - optional => 1,
>> - description => 'type of exit action',
>> - },
>> + value => get_standard_option('pve-sdn-route-map-order'),
>
> Don't we need an ', { optional => 1 }' here?
yes, indeed!
https://lore.proxmox.com/pve-devel/09f5cf1a-16ec-49d4-a4de-2b412f385988@proxmox.com/T/#t
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-13 11:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 13:43 [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action Stefan Hanreich
2026-05-13 3:08 ` applied: " Thomas Lamprecht
2026-05-13 8:15 ` Fiona Ebner
2026-05-13 11:50 ` Stefan Hanreich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.