Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/thick-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -89,7 +90,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,
}
```

Expand Down
1 change: 1 addition & 0 deletions pkg/server/config/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,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"`
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/server/config/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down