Docs and remove uppercase since it's checked at the config parse step

This commit is contained in:
Chris Bednarski
2015-09-23 15:28:58 -07:00
parent 67a891b19a
commit 592b45d93a
2 changed files with 5 additions and 4 deletions

View File

@@ -116,14 +116,15 @@ func PopulateEnvironment(ctx *ExecContext, task *structs.Task) []string {
env = append(env, fmt.Sprintf("NOMAD_MEMORY_LIMIT=%d", task.Resources.MemoryMB))
env = append(env, fmt.Sprintf("NOMAD_CPU_LIMIT=%d", task.Resources.CPU))
// Named Ports
if len(task.Resources.Networks) > 0 {
network := task.Resources.Networks[0]
env = append(env, fmt.Sprintf("NOMAD_HOST_IP=%s", network.IP))
// IP address for this task
env = append(env, fmt.Sprintf("NOMAD_IP=%s", network.IP))
// Named ports for this task
for label, port := range network.MapDynamicPorts() {
env = append(env, fmt.Sprintf("NOMAD_PORT_%s=%d", strings.ToUpper(label), port))
env = append(env, fmt.Sprintf("NOMAD_PORT_%s=%d", label, port))
}
}
}

View File

@@ -54,7 +54,7 @@ the private port number. For example, `dynamic_ports = ["5000"]` will have a
random port mapped to port 5000 inside the container or VM. These ports are also
exported as environment variables for consistency, e.g. `NOMAD_PORT_5000`.
Please see the relevant driver documentation for exact details.
Please see the relevant driver documentation for details.
## Meta