mirror of https://github.com/status-im/consul.git
command/connect/proxy: set proxy ID from env var if set
This commit is contained in:
parent
6e386ba6be
commit
867db89303
|
@ -7,7 +7,9 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof" // Expose pprof if configured
|
||||
"os"
|
||||
|
||||
proxyAgent "github.com/hashicorp/consul/agent/proxy"
|
||||
"github.com/hashicorp/consul/command/flags"
|
||||
proxyImpl "github.com/hashicorp/consul/connect/proxy"
|
||||
|
||||
|
@ -74,6 +76,10 @@ func (c *cmd) Run(args []string) int {
|
|||
return 1
|
||||
}
|
||||
|
||||
// Load the proxy ID and token from env vars if they're set
|
||||
if c.proxyID == "" {
|
||||
c.proxyID = os.Getenv(proxyAgent.EnvProxyId)
|
||||
}
|
||||
// Setup the log outputs
|
||||
logConfig := &logger.Config{
|
||||
LogLevel: c.logLevel,
|
||||
|
|
|
@ -68,7 +68,6 @@ func New(client *api.Client, proxyID string, logger *log.Logger) (*Proxy, error)
|
|||
|
||||
// Serve the proxy instance until a fatal error occurs or proxy is closed.
|
||||
func (p *Proxy) Serve() error {
|
||||
|
||||
var cfg *Config
|
||||
|
||||
// Watch for config changes (initial setup happens on first "change")
|
||||
|
|
Loading…
Reference in New Issue