|
|
@ -40,6 +40,7 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
|
|
|
|
return nil, errors.Errorf("%s driver requires docker API access", f.Name())
|
|
|
|
return nil, errors.Errorf("%s driver requires docker API access", f.Name())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d := &Driver{factory: f, InitConfig: cfg}
|
|
|
|
d := &Driver{factory: f, InitConfig: cfg}
|
|
|
|
|
|
|
|
d.securityOpts = make(map[string]string)
|
|
|
|
for k, v := range cfg.DriverOpts {
|
|
|
|
for k, v := range cfg.DriverOpts {
|
|
|
|
switch {
|
|
|
|
switch {
|
|
|
|
case k == "network":
|
|
|
|
case k == "network":
|
|
|
@ -57,6 +58,14 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
|
|
|
|
return nil, errors.Errorf("invalid env option %q, expecting env.FOO=bar", k)
|
|
|
|
return nil, errors.Errorf("invalid env option %q, expecting env.FOO=bar", k)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d.env = append(d.env, fmt.Sprintf("%s=%s", envName, v))
|
|
|
|
d.env = append(d.env, fmt.Sprintf("%s=%s", envName, v))
|
|
|
|
|
|
|
|
case k == "seccomp":
|
|
|
|
|
|
|
|
d.securityOpts[k] = v
|
|
|
|
|
|
|
|
case k == "apparmor":
|
|
|
|
|
|
|
|
d.securityOpts[k] = v
|
|
|
|
|
|
|
|
case k == "systempaths":
|
|
|
|
|
|
|
|
d.securityOpts[k] = v
|
|
|
|
|
|
|
|
case k == "privileged":
|
|
|
|
|
|
|
|
d.securityOpts[k] = v
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return nil, errors.Errorf("invalid driver option %s for docker-container driver", k)
|
|
|
|
return nil, errors.Errorf("invalid driver option %s for docker-container driver", k)
|
|
|
|
}
|
|
|
|
}
|
|
|
|