Avoid redundant client creation (#6361)

This commit is contained in:
Vishal Nayak 2019-03-06 22:09:55 -05:00 committed by GitHub
parent 01af049b98
commit 25b055505a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 10 deletions

View File

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