public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action
Date: Tue, 12 May 2026 15:43:34 +0200	[thread overview]
Message-ID: <20260512134336.312909-1-s.hanreich@proxmox.com> (raw)

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





             reply	other threads:[~2026-05-12 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 13:43 Stefan Hanreich [this message]
2026-05-13  3:08 ` applied: [PATCH pve-network 1/1] sdn: api: route maps: fix json schema for match, set and exit-action Thomas Lamprecht
2026-05-13  8:15 ` Fiona Ebner
2026-05-13 11:50   ` Stefan Hanreich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260512134336.312909-1-s.hanreich@proxmox.com \
    --to=s.hanreich@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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