diff --git a/pkg/server/config/manager.go b/pkg/server/config/manager.go index b2fdc5fa4..3d2678b11 100644 --- a/pkg/server/config/manager.go +++ b/pkg/server/config/manager.go @@ -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 } @@ -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, } @@ -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 {