Skip to content

Commit

Permalink
server/config: use filepath.Join()
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
dcbw committed Sep 13, 2023
1 parent 96439ff commit 73c21ff
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/server/config/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func overrideCNIVersion(cniConfigFile string, multusCNIVersion string) error {

func newManager(config MultusConf, defaultCNIPluginName string) (*Manager, error) {
if config.ForceCNIVersion {
err := overrideCNIVersion(cniPluginConfigFilePath(config.MultusAutoconfigDir, defaultCNIPluginName), config.CNIVersion)
err := overrideCNIVersion(filepath.Join(config.MultusAutoconfigDir, defaultCNIPluginName), config.CNIVersion)
if err != nil {
return nil, err
}
Expand All @@ -115,8 +115,8 @@ func newManager(config MultusConf, defaultCNIPluginName string) (*Manager, error
configWatcher: watcher,
multusConfig: &config,
multusConfigDir: config.MultusAutoconfigDir,
multusConfigFilePath: cniPluginConfigFilePath(config.CniConfigDir, multusConfigFileName),
primaryCNIConfigPath: cniPluginConfigFilePath(config.MultusAutoconfigDir, defaultCNIPluginName),
multusConfigFilePath: filepath.Join(config.CniConfigDir, multusConfigFileName),
primaryCNIConfigPath: filepath.Join(config.MultusAutoconfigDir, defaultCNIPluginName),
readinessIndicatorFilePath: config.ReadinessIndicatorFile,
}

Expand Down Expand Up @@ -287,10 +287,6 @@ func getPrimaryCNIPluginName(multusAutoconfigDir string) (string, error) {
return masterCniConfigFileName, nil
}

func cniPluginConfigFilePath(cniConfigDir string, cniConfigFileName string) string {
return cniConfigDir + fmt.Sprintf("/%s", cniConfigFileName)
}

func newWatcher(cniConfigDir string, readinessIndicatorDir string) (*fsnotify.Watcher, error) {
watcher, err := fsnotify.NewWatcher()
if err != nil {
Expand Down

0 comments on commit 73c21ff

Please sign in to comment.