ironcore-dev / metalbond

Route reflector for IronCore Infrastructure Overlay Network
Apache License 2.0
0 stars 1 forks source link

Error getting routes in json format #92

Closed vlorinc closed 8 months ago

vlorinc commented 8 months ago

Describe the bug

When getting routes in json format from URL []:4712/rotues.json of running metalbond, there is error Error: json: unsupported type: map[metalbond.Destination][]metalbond.NextHop

Expected behavior

Show current metalbond routes in json format.

Additional contex

Routes in yaml format ([]:4712/rotues.yaml) are shown correctly.

vlorinc commented 8 months ago

Fix provided in branch fix/routes_json_handler. PR will be opened. Issue caused by changing key of map from string to struct of type Destination which didn't implement encoding.TextMarshaler so json was not able to marshal this struct. MarshalText and UnmarshalText methods were added to fix this problem.