Skip to content

Commit

Permalink
Addressed some review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed Nov 17, 2015
1 parent 6403375 commit b8d468f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
20 changes: 10 additions & 10 deletions client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ type DockerAuthConfig struct {

type DockerDriverConfig struct {
DockerAuthConfig
ImageName string `mapstructure:"image"` // Container's Image Name
Command string `mapstructure:"command"` // The Command/Entrypoint to run when the container starts up
Args string `mapstructure:"args"` // The arguments to the Command/Entrypoint
NetworkMode string `mapstructure:"network_mode"` // The network mode of the container - host, net and none
PortMap []map[string]int `mapstructure:"port_map"` // A map of host port labels and the ports exposed on the container
Privileged bool `mapstructure:"privileged"` // Flag to run the container in priviledged mode
DNS string `mapstructure:"dns_server"` // DNS Server for containers
SearchDomains string `mapstructure:"search_domains"`
ImageName string `mapstructure:"image"` // Container's Image Name
Command string `mapstructure:"command"` // The Command/Entrypoint to run when the container starts up
Args string `mapstructure:"args"` // The arguments to the Command/Entrypoint
NetworkMode string `mapstructure:"network_mode"` // The network mode of the container - host, net and none
PortMap []map[string]int `mapstructure:"port_map"` // A map of host port labels and the ports exposed on the container
Privileged bool `mapstructure:"privileged"` // Flag to run the container in priviledged mode
DNS string `mapstructure:"dns_server"` // DNS Server for containers
SearchDomains string `mapstructure:"search_domains"` // DNS Search domains for containers
}

func (c *DockerDriverConfig) Validate() error {
Expand Down Expand Up @@ -311,8 +311,8 @@ func (d *DockerDriver) createContainer(ctx *ExecContext, task *structs.Task, dri

// If the user specified a custom command to run as their entrypoint, we'll
// inject it here.
if command := driverConfig.Command; command != "" {
cmd := []string{command}
if driverConfig.Command != "" {
cmd := []string{driverConfig.Command}
if driverConfig.Args != "" {
cmd = append(cmd, parsedArgs...)
}
Expand Down
7 changes: 3 additions & 4 deletions client/driver/java.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ func (d *JavaDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle,

args := []string{}
// Look for jvm options
jvm_options := driverConfig.JvmOpts
if jvm_options != "" {
d.logger.Printf("[DEBUG] driver.java: found JVM options: %s", jvm_options)
args = append(args, jvm_options)
if driverConfig.JvmOpts != "" {
d.logger.Printf("[DEBUG] driver.java: found JVM options: %s", driverConfig.JvmOpts)
args = append(args, driverConfig.JvmOpts)
}

// Build the argument list.
Expand Down

0 comments on commit b8d468f

Please sign in to comment.