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(junos): trying to clean route-map still being used #25

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

kpetremann
Copy link
Contributor

@kpetremann kpetremann commented Sep 17, 2024

AFK autogenerates policies per relevant SAFIs. A SAFI is relevant only if at least one BGP session uses in this SAFI.

Before this PR, we were always deleting autogenerated policies for all SAFIs, including non relevant SAFIs..
The purpose of the deletion is to start from a clean slate when recreating a policy (to avoid extra terms/options in the policy).
note: the goal is not to remove extra policies, which must be done in a dedicated step.

The issue is that we push routing_policy update before BGP. The result is that if the BGP session disappears from openconfig, the SAFI becomes relevant and by side effect was removed (as we delete for all SAFIs), while the BGP session was not yet removed from the config yet, resulting in configuration failure.

We should never remove a policy which is still in use (this is why the cleaning must be done in a dedicated step).

In this context, we now only delete policies we still maintain (so which will be recreated right after the deletion).

@kpetremann kpetremann force-pushed the fix_junos_rp_autodelete branch from ee68f78 to be31afe Compare September 17, 2024 14:30
Before this commit, we were always deleting autogenerated route-map for
all SAFIs.

The purpose of the deletion is to start from a clean slate
when recreating a route-map (to avoid extra terms/options in the
route-map). The goal is not to remove extra policies, which must be done
in a dedicated step.

So this commit aims to only delete policy which will be recreated, to
avoid removing an autogenerated route-map which is still in use in the
actual configuration
@kpetremann kpetremann force-pushed the fix_junos_rp_autodelete branch from be31afe to 464b6fb Compare September 17, 2024 14:56
@kpetremann kpetremann merged commit fb7a877 into criteo:main Sep 17, 2024
2 checks passed
@kpetremann kpetremann deleted the fix_junos_rp_autodelete branch September 18, 2024 08:19
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