From 277d5ddb36c036ea405c8c6ba635be7c7c57954a Mon Sep 17 00:00:00 2001 From: Kate Taggart Date: Wed, 29 Mar 2017 16:31:23 -0700 Subject: [PATCH] allow region to also be interpolated, like datacenter. --- client/driver/env/env.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/driver/env/env.go b/client/driver/env/env.go index 90b7d2cfe..a8ccca249 100644 --- a/client/driver/env/env.go +++ b/client/driver/env/env.go @@ -78,10 +78,11 @@ const ( // The node values that can be interpreted. const ( - nodeIdKey = "node.unique.id" - nodeDcKey = "node.datacenter" - nodeNameKey = "node.unique.name" - nodeClassKey = "node.class" + nodeIdKey = "node.unique.id" + nodeDcKey = "node.datacenter" + nodeRegionKey = "node.region" + nodeNameKey = "node.unique.name" + nodeClassKey = "node.class" // Prefixes used for lookups. nodeAttributePrefix = "attr." @@ -241,6 +242,7 @@ func (t *TaskEnvironment) Build() *TaskEnvironment { // Set up the node values. t.NodeValues[nodeIdKey] = t.Node.ID t.NodeValues[nodeDcKey] = t.Node.Datacenter + t.NodeValues[nodeRegionKey] = t.Node.Region t.NodeValues[nodeNameKey] = t.Node.Name t.NodeValues[nodeClassKey] = t.Node.NodeClass