public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal