From 5509920a8ab4c5a216468f262fc07c98121dce35 Mon Sep 17 00:00:00 2001 From: Mike Jarmy Date: Wed, 4 Dec 2019 09:39:57 -0500 Subject: [PATCH] tweak service_registration config --- command/server/config.go | 4 ++-- command/server/config_test_helpers.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/command/server/config.go b/command/server/config.go index b4eb5b2ed17d..4568849e30fc 100644 --- a/command/server/config.go +++ b/command/server/config.go @@ -155,7 +155,7 @@ func (b *Storage) GoString() string { // ServiceRegistration is the optional service discovery for the server. type ServiceRegistration struct { Type string - Config map[string]string + Config map[string]interface{} } func (b *ServiceRegistration) GoString() string { @@ -864,7 +864,7 @@ func parseServiceRegistration(result *Config, list *ast.ObjectList, name string) key = item.Keys[0].Token.Value().(string) } - var m map[string]string + var m map[string]interface{} if err := hcl.DecodeObject(&m, item.Val); err != nil { return multierror.Prefix(err, fmt.Sprintf("%s.%s:", name, key)) } diff --git a/command/server/config_test_helpers.go b/command/server/config_test_helpers.go index b639a7e01b84..e9cba4784667 100644 --- a/command/server/config_test_helpers.go +++ b/command/server/config_test_helpers.go @@ -49,7 +49,7 @@ func testLoadConfigFile_topLevel(t *testing.T, entropy *Entropy) { ServiceRegistration: &ServiceRegistration{ Type: "consul", - Config: map[string]string{ + Config: map[string]interface{}{ "foo": "bar", }, }, @@ -135,7 +135,7 @@ func testLoadConfigFile_json2(t *testing.T, entropy *Entropy) { ServiceRegistration: &ServiceRegistration{ Type: "consul", - Config: map[string]string{ + Config: map[string]interface{}{ "foo": "bar", }, }, @@ -277,7 +277,7 @@ func testLoadConfigFile(t *testing.T) { ServiceRegistration: &ServiceRegistration{ Type: "consul", - Config: map[string]string{ + Config: map[string]interface{}{ "foo": "bar", }, }, @@ -347,7 +347,7 @@ func testLoadConfigFile_json(t *testing.T) { ServiceRegistration: &ServiceRegistration{ Type: "consul", - Config: map[string]string{ + Config: map[string]interface{}{ "foo": "bar", }, },