Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): safi disappearing for PATCH requests #37

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

kpetremann
Copy link
Contributor

When trying to update a BGP session via a PATCH request, it removes the safis even if the key is not in the request:

[
    {
        "id": 1,
        "peer_a": {
            "device": {"id": 178623, "name": "toto"},
            "local_address": {"id": 1, "address": "10.0.0.0/31"},
            "afi_safis": [
                {
                    "id": 1,
                    "route_policy_in": None,
                    "route_policy_out": {
                        "name": "MAINTENANCE",
                        "device": {"name": "toto"},
                    },
                    "afi_safi_name": "ipv4-unicast",
                }
            ],
        },
        "peer_b": {
            "device": {"id": 2, "name": "tata"},
            "local_address": {"id": 2, "address": "10.0.0.1/31"},
        },
    }
]

here, the peer_a is updated with the new afi safi settings, but peer_b looses its safis if it had one.

@kpetremann kpetremann requested review from a team July 30, 2024 13:16
@kpetremann kpetremann merged commit 3b3a997 into criteo:main Aug 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants