From 25b055505afa5de97f7d8ed65e6b43f03791a34a Mon Sep 17 00:00:00 2001 From: Vishal Nayak Date: Wed, 6 Mar 2019 22:09:55 -0500 Subject: [PATCH] Avoid redundant client creation (#6361) --- command/agent.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/command/agent.go b/command/agent.go index e47599f89..1bf33cb2e 100644 --- a/command/agent.go +++ b/command/agent.go @@ -372,16 +372,6 @@ func (c *AgentCommand) Run(args []string) int { if config.Cache != nil && len(config.Cache.Listeners) != 0 { cacheLogger := c.logger.Named("cache") - // Ensure that the connection from agent to Vault server doesn't loop - // back to agent. - apiConfig := api.DefaultConfig() - apiConfig.AgentAddress = "" - client, err := api.NewClient(apiConfig) - if err != nil { - c.UI.Error(fmt.Sprintf("Error creating API client for cache: %v", err)) - return 1 - } - // Create the API proxier apiProxy, err := cache.NewAPIProxy(&cache.APIProxyConfig{ Client: client,