From 30307f877b6816214f355531b6f57976370d190b Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Thu, 3 Apr 2014 14:22:43 -0700 Subject: [PATCH] agent: Add backwards compatibility hack for old 'tag' definitions --- command/agent/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/command/agent/config.go b/command/agent/config.go index ad8a8b8754..a2e83740b9 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -186,6 +186,14 @@ func DecodeServiceDefinition(raw interface{}) (*ServiceDefinition, error) { if !ok { goto AFTER_FIX } + + // If no 'tags', handle the deprecated 'tag' value. + if _, ok := rawMap["tags"]; !ok { + if tag, ok := rawMap["tag"]; ok { + rawMap["tags"] = []interface{}{tag} + } + } + sub, ok = rawMap["check"] if !ok { goto AFTER_FIX