dataplaneapi icon indicating copy to clipboard operation
dataplaneapi copied to clipboard

`Add a new entry in the map` endpoint checks for duplicates and `Add a new payload` does not

Open linoor opened this issue 3 years ago • 2 comments

Hello,

I've noticed that when I try to add an entry multiple times to a map file with POST http://{{url}}/v2/services/haproxy/runtime/maps_entries?map=routing.map endpoint I will get:

{
    "code": 409,
    "message": "already exists"
}

However, if I use POST http://{{url}}/v2/services/haproxy/runtime/maps/routing.map multiple times, the uniqueness check doesn't seem to be performed and Return one map runtime entries returns duplicates:

{
    {
        "id": "0xffffaf6ccdb0",
        "key": "host1",
        "value": "server1"
    },
    {
        "id": "0xffffaf6cce50",
        "key": "host2",
        "value": "server2"
    },
    {
        "id": "0xffffaf6cdef0",
        "key": "host1",
        "value": "server1"
    },
    {
        "id": "0xffffaf6cdf90",
        "key": "host2",
        "value": "server2"
    }
}

linoor avatar Jun 13 '22 15:06 linoor

This seems to be a bug and we definitely need to check this, thanks for reporting.

mjuraga avatar Jun 20 '22 13:06 mjuraga

Any progress on this? I'm running into the exact same issue.

june07 avatar Jan 18 '23 18:01 june07