From f5ccc6529596da63b5923252c4c47135c4a70c64 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 3 May 2018 17:51:49 -0700 Subject: [PATCH] agent: only set the proxy manager data dir if its set --- agent/agent.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index 2c18c08d3a..6f7531ed96 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -363,7 +363,12 @@ func (a *Agent) Start() error { a.proxyManager = proxy.NewManager() a.proxyManager.State = a.State a.proxyManager.Logger = a.logger - a.proxyManager.DataDir = filepath.Join(a.config.DataDir, "proxy") + if a.config.DataDir != "" { + // DataDir is required for all non-dev mode agents, but we want + // to allow setting the data dir for demos and so on for the agent, + // so do the check above instead. + a.proxyManager.DataDir = filepath.Join(a.config.DataDir, "proxy") + } go a.proxyManager.Run() // Start watching for critical services to deregister, based on their