Skip to content

Commit

Permalink
feat: copy pathvector config file to cache directory (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Jul 18, 2023
1 parent 1c47a30 commit 38aea5e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/bird/bird.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ func MoveCacheAndReconfigure(birdDirectory string, cacheDirectory string, birdSo
}
}

// Move config file
log.Debug("Moving Pathvector config file")
configFilename := "pathvector.yml"
if err := util.MoveFile(
path.Join(cacheDirectory, configFilename),
path.Join(birdDirectory, configFilename),
); err != nil {
log.Fatalf("Moving pathvector config file: %v", err)
}

if !noConfigure {
log.Info("Reconfiguring BIRD")
resp, _, err := RunCommand("configure", birdSocket)
Expand Down
6 changes: 6 additions & 0 deletions pkg/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,12 @@ func Run(configFilename, lockFile, version string, noConfigure, dryRun, withdraw
// Run BIRD config validation
bird.Validate(c.BIRDBinary, c.CacheDirectory)

// Copy config file
log.Debug("Copying Pathvector config file to cache directory")
if err := util.CopyFile(configFilename, path.Join(c.CacheDirectory, "pathvector.yml")); err != nil {
log.Fatalf("Copying pathvector config file to cache directory: %v", err)
}

if !dryRun {
// Write protocol name map
names := templating.ProtocolNames()
Expand Down

0 comments on commit 38aea5e

Please sign in to comment.