host-local: add DataDir IPAM conf option and use it for testcases
Add an e2e host-local plugin testcase, which requires being able to pass the datadir into the plugin so we can erase it later. We're not always guaranteed to have access to the default data dir location, plus it should probably be configurable anyway.
This commit is contained in:
@ -31,8 +31,11 @@ type Store struct {
|
||||
dataDir string
|
||||
}
|
||||
|
||||
func New(network string) (*Store, error) {
|
||||
dir := filepath.Join(defaultDataDir, network)
|
||||
func New(network, dataDir string) (*Store, error) {
|
||||
if dataDir == "" {
|
||||
dataDir = defaultDataDir
|
||||
}
|
||||
dir := filepath.Join(dataDir, network)
|
||||
if err := os.MkdirAll(dir, 0644); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user