Browse code

Move -o cli flag and DriverConfig from HostConfig Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Michael Crosby authored on 2014/04/08 04:40:41
Showing 3 changed files
... ...
@@ -14,7 +14,6 @@ type HostConfig struct {
14 14
 	PortBindings    nat.PortMap
15 15
 	Links           []string
16 16
 	PublishAllPorts bool
17
-	DriverOptions   map[string][]string
18 17
 }
19 18
 
20 19
 func ContainerHostConfigFromJob(job *engine.Job) *HostConfig {
... ...
@@ -25,7 +24,6 @@ func ContainerHostConfigFromJob(job *engine.Job) *HostConfig {
25 25
 	}
26 26
 	job.GetenvJson("LxcConf", &hostConfig.LxcConf)
27 27
 	job.GetenvJson("PortBindings", &hostConfig.PortBindings)
28
-	job.GetenvJson("DriverOptions", &hostConfig.DriverOptions)
29 28
 	if Binds := job.GetenvList("Binds"); Binds != nil {
30 29
 		hostConfig.Binds = Binds
31 30
 	}
... ...
@@ -45,7 +45,6 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
45 45
 		flDnsSearch   = opts.NewListOpts(opts.ValidateDomain)
46 46
 		flVolumesFrom opts.ListOpts
47 47
 		flLxcOpts     opts.ListOpts
48
-		flDriverOpts  opts.ListOpts
49 48
 		flEnvFile     opts.ListOpts
50 49
 
51 50
 		flAutoRemove      = cmd.Bool([]string{"#rm", "-rm"}, false, "Automatically remove the container when it exits (incompatible with -d)")
... ...
@@ -79,8 +78,7 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
79 79
 	cmd.Var(&flDns, []string{"#dns", "-dns"}, "Set custom dns servers")
80 80
 	cmd.Var(&flDnsSearch, []string{"-dns-search"}, "Set custom dns search domains")
81 81
 	cmd.Var(&flVolumesFrom, []string{"#volumes-from", "-volumes-from"}, "Mount volumes from the specified container(s)")
82
-	cmd.Var(&flLxcOpts, []string{"#lxc-conf", "#-lxc-conf"}, "(lxc exec-driver only) Add custom lxc options --lxc-conf=\"lxc.cgroup.cpuset.cpus = 0,1\"")
83
-	cmd.Var(&flDriverOpts, []string{"o", "-opt"}, "Add custom driver options")
82
+	cmd.Var(&flLxcOpts, []string{"#lxc-conf", "-lxc-conf"}, "(lxc exec-driver only) Add custom lxc options --lxc-conf=\"lxc.cgroup.cpuset.cpus = 0,1\"")
84 83
 
85 84
 	if err := cmd.Parse(args); err != nil {
86 85
 		return nil, nil, cmd, err
... ...
@@ -224,11 +222,6 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
224 224
 		WorkingDir:      *flWorkingDir,
225 225
 	}
226 226
 
227
-	driverOptions, err := parseDriverOpts(flDriverOpts)
228
-	if err != nil {
229
-		return nil, nil, cmd, err
230
-	}
231
-
232 227
 	hostConfig := &HostConfig{
233 228
 		Binds:           binds,
234 229
 		ContainerIDFile: *flContainerIDFile,
... ...
@@ -237,7 +230,6 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
237 237
 		PortBindings:    portBindings,
238 238
 		Links:           flLinks.GetAll(),
239 239
 		PublishAllPorts: *flPublishAll,
240
-		DriverOptions:   driverOptions,
241 240
 	}
242 241
 
243 242
 	if sysInfo != nil && flMemory > 0 && !sysInfo.SwapLimit {
... ...
@@ -361,12 +361,8 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s
361 361
 func populateCommand(c *Container) {
362 362
 	var (
363 363
 		en           *execdriver.Network
364
-		driverConfig = c.hostConfig.DriverOptions
365
-	)
366
-
367
-	if driverConfig == nil {
368 364
 		driverConfig = make(map[string][]string)
369
-	}
365
+	)
370 366
 
371 367
 	en = &execdriver.Network{
372 368
 		Mtu:       c.runtime.config.Mtu,