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

Dry run generate config with diff against current config #185

Closed
RX14 opened this issue Jul 16, 2023 · 2 comments
Closed

Dry run generate config with diff against current config #185

RX14 opened this issue Jul 16, 2023 · 2 comments

Comments

@RX14
Copy link

RX14 commented Jul 16, 2023

Currently there is a "dry run" option for pathvector, but it would be lovely to dry-run pathvector generate and have pathvector show the diff between the files which would have been generated and the current config. This would help to see the details of how the bird config changes when a new config or even a new pathvector version is used.

@RX14 RX14 changed the title Diff Dry run generate config with diff against current config Jul 16, 2023
@natesales
Copy link
Owner

Pathvector stores the output of a dry run in cache-directory (defaults to /var/run/pathvector/cache/), so you can already diff the output:

$ pathvector gen --dry-run
INFO[0000] Starting Pathvector 6.3.2                    
INFO[0005] BIRD config validation passed                
INFO[0005] Processed 8 peers in 5s                      
$ diff /var/run/pathvector/cache/ /etc/bird/
Only in /etc/bird/: AS34553_LGAS34553NET.conf
diff /var/run/pathvector/cache/bird.conf /etc/bird/bird.conf
1c1
< # Update time: 1689659925
---
> # Update time: 1689659872
Only in /etc/bird/: envvars
Only in /etc/bird/: protocols.json

If there were to be config changes other than removing a peer, you'd see the individual line diffs too.

@RX14
Copy link
Author

RX14 commented Jul 18, 2023

I didn't realise this, thanks!

Should this perhaps be documented somewhere?

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

No branches or pull requests

2 participants