mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-31 16:38:43 +00:00
Merge bfc8f36cc4
into 00adf22482
This commit is contained in:
@@ -66,6 +66,7 @@ The server configuration is encoded in JSON, and allows the following keys:
|
||||
- `"socketDir"`: Specify the location where the unix domain socket used
|
||||
for client/server communication will be located. This is the location where the
|
||||
**Daemon** will read the configuration from. Defaults to `"/run/multus"`.
|
||||
- `multusKeepConfig`: Specify whether to keep the generated multus CNI config or not. Defaults to `false`, which means that the multus config file (e.g. `/etc/cni/net.d/00-multus.conf` will be deleted automatically when the multus-daemon is deleted).
|
||||
- `"metricsPort"`: Metrics port (of multus' metric exporter); by default, no port
|
||||
is provided.
|
||||
- `"logFile"`: the path to where the daemon logs will be persisted.
|
||||
@@ -90,7 +91,8 @@ Below you can see an example of the daemon configuration:
|
||||
"cniVersion": "0.3.1",
|
||||
"cniConfigDir": "/host/etc/cni/net.d",
|
||||
"multusConfigFile": "auto",
|
||||
"multusAutoconfigDir": "/host/etc/cni/net.d"
|
||||
"multusAutoconfigDir": "/host/etc/cni/net.d",
|
||||
"multusKeepConfig": true,
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -60,6 +60,7 @@ type MultusConf struct {
|
||||
MultusConfigFile string `json:"multusConfigFile,omitempty"`
|
||||
MultusMasterCni string `json:"multusMasterCNI,omitempty"`
|
||||
MultusAutoconfigDir string `json:"multusAutoconfigDir,omitempty"`
|
||||
MultusKeepConfig bool `json:"multusKeepConfig,omitempty"`
|
||||
ForceCNIVersion bool `json:"forceCNIVersion,omitempty"`
|
||||
OverrideNetworkName bool `json:"overrideNetworkName,omitempty"`
|
||||
}
|
||||
|
@@ -159,8 +159,11 @@ func (m *Manager) Start(ctx context.Context, wg *sync.WaitGroup) error {
|
||||
_ = logging.Errorf("error watching file: %v", err)
|
||||
}
|
||||
logging.Verbosef("ConfigWatcher done")
|
||||
logging.Verbosef("Delete old config @ %v", multusConfigFile)
|
||||
os.Remove(multusConfigFile)
|
||||
|
||||
if !m.multusConfig.MultusKeepConfig {
|
||||
logging.Verbosef("Delete old config @ %v", multusConfigFile)
|
||||
os.Remove(multusConfigFile)
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user