From f559f7eec2a09b85bd5018ec3ab3d6d217a92c5b Mon Sep 17 00:00:00 2001 From: James Powis Date: Sat, 4 Nov 2017 16:37:48 -0600 Subject: [PATCH] [3503] adding consul-address flag to command.go fixing --- command/agent/command.go | 1 + command/agent/command_test.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index 902d1cbec766..eb5be1c35ae5 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -134,6 +134,7 @@ func (c *Command) readConfig() *Config { cmdConfig.Consul.VerifySSL = &b return nil }), "consul-verify-ssl", "") + flags.StringVar(&cmdConfig.Consul.Addr, "consul-address", "", "") // Vault options flags.Var((flaghelper.FuncBoolVar)(func(b bool) error { diff --git a/command/agent/command_test.go b/command/agent/command_test.go index e9492ea1daa9..d8bfe8a7fad7 100644 --- a/command/agent/command_test.go +++ b/command/agent/command_test.go @@ -50,6 +50,10 @@ func TestCommand_Args(t *testing.T) { []string{"-client", "-alloc-dir="}, "Must specify both the state and alloc dir if data-dir is omitted.", }, + { + []string{"-client", "-consul-address=1.2.3.4:8500"}, + "No configuration files loaded", + }, } for _, tc := range tcases { // Make a new command. We pre-emptively close the shutdownCh