mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
Docs and remove uppercase since it's checked at the config parse step
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user