Skip to content

Commit

Permalink
rename fixCfgReplacements to applyCfgReplacements
Browse files Browse the repository at this point in the history
  • Loading branch information
chdxD1 committed Sep 20, 2024
1 parent 73fdf33 commit 1f5aecc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/frr/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (m *Manager) Configure(in Configuration, nm *nl.Manager, nwopCfg *config.Co
}

targetConfig = fixRouteTargetReload(targetConfig)
targetConfig = fixCfgReplacements(targetConfig, nwopCfg.Replacements)
targetConfig = applyCfgReplacements(targetConfig, nwopCfg.Replacements)

if !bytes.Equal(currentConfig, targetConfig) {
err = os.WriteFile(m.ConfigPath, targetConfig, frrPermissions)
Expand Down Expand Up @@ -175,8 +175,8 @@ func fixRouteTargetReload(frrConfig []byte) []byte {
})
}

// fixCfgReplacements replaces placeholders in the configuration with the actual values.
func fixCfgReplacements(frrConfig []byte, replacements []config.Replacement) []byte {
// applyCfgReplacements replaces placeholders in the configuration with the actual values.
func applyCfgReplacements(frrConfig []byte, replacements []config.Replacement) []byte {
for _, replacement := range replacements {
if !replacement.Regex {
frrConfig = bytes.ReplaceAll(frrConfig, []byte(replacement.Old), []byte(replacement.New))
Expand Down

0 comments on commit 1f5aecc

Please sign in to comment.