agent: Add backwards compatibility hack for old 'tag' definitions

This commit is contained in:
Armon Dadgar 2014-04-03 14:22:43 -07:00
parent 6e26f463a5
commit 30307f877b
1 changed files with 8 additions and 0 deletions

View File

@ -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