From b8d468f5ad01c6055f7298649d02207fca557f00 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Mon, 16 Nov 2015 22:29:06 -0500 Subject: [PATCH] Addressed some review comments --- client/driver/docker.go | 20 ++++++++++---------- client/driver/java.go | 7 +++---- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/client/driver/docker.go b/client/driver/docker.go index f218a911f..f2d25f9ba 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -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 { @@ -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...) } diff --git a/client/driver/java.go b/client/driver/java.go index 1f5197647..eb2930a28 100644 --- a/client/driver/java.go +++ b/client/driver/java.go @@ -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.