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

Rajiv Asati's Update to plugin_impl_gobgp.go #24

Merged
merged 2 commits into from
May 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions bgp/gobgp/plugin_impl_gobgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ func (plugin *Plugin) Init() error {
return nil
}

// applyExternalConfig tries to find and load configuration from external filesystem and change it for injected configuration, because external configuration has higher priority.
// applyExternalConfig tries to find and load BGP configuration from external .yaml file and change it accordingly for injected configuration, because external configuration has higher priority.
// If external configuration is not found or can't be loaded or other problem occur, plugin.SessionConfig is not changed. This means that previous injection of plugin.SessionConfig
// variable can be still used.
func (plugin *Plugin) applyExternalConfig() {
var externalCfg *config.Bgp
found, err := plugin.PluginConfig.GetValue(externalCfg) // It tries to lookup `PluginName + "-config"` in go run command flags.
func (plugin *Plugin) applyExternalConfig() {
var externalCfg config.Bgp
found, err := plugin.PluginConfig.GetValue(&externalCfg) // It tries to lookup `PluginName + "-config"` in go run command flags.
if err != nil {
plugin.Log.Debug("External GoBGP plugin configuration could not load or other problem happened", err)
return
Expand All @@ -77,7 +77,7 @@ func (plugin *Plugin) applyExternalConfig() {
plugin.Log.Debug("External GoBGP plugin configuration was not found")
return
}
plugin.SessionConfig = externalCfg
plugin.SessionConfig = &externalCfg
}

// AfterInit starts gobgp with dedicated goroutine for watching gobgp and forwarding best path reachable ip routes to registered watchers.
Expand Down