Support setting datacenter when using consul remote state (#8102)
* Support setting datacenter when using consul remote state Change-Id: I8c03f4058e9373f0de8fde7ce291ec552321cc60 * Add documentation for setting datacenter when using consul remote state Change-Id: Ia62feea7a910a76308f0a5e7f9505c9a210e0339
This commit is contained in:
parent
66a14cb3b7
commit
ee9ebe849f
|
@ -24,6 +24,9 @@ func consulFactory(conf map[string]string) (Client, error) {
|
||||||
if scheme, ok := conf["scheme"]; ok && scheme != "" {
|
if scheme, ok := conf["scheme"]; ok && scheme != "" {
|
||||||
config.Scheme = scheme
|
config.Scheme = scheme
|
||||||
}
|
}
|
||||||
|
if datacenter, ok := conf["datacenter"]; ok && datacenter != "" {
|
||||||
|
config.Datacenter = datacenter
|
||||||
|
}
|
||||||
if auth, ok := conf["http_auth"]; ok && auth != "" {
|
if auth, ok := conf["http_auth"]; ok && auth != "" {
|
||||||
var username, password string
|
var username, password string
|
||||||
if strings.Contains(auth, ":") {
|
if strings.Contains(auth, ":") {
|
||||||
|
|
|
@ -44,5 +44,6 @@ The following configuration options / environment variables are supported:
|
||||||
* `scheme` - (Optional) Specifies what protocol to use when talking to the given
|
* `scheme` - (Optional) Specifies what protocol to use when talking to the given
|
||||||
`address`, either `http` or `https`. SSL support can also be triggered
|
`address`, either `http` or `https`. SSL support can also be triggered
|
||||||
by setting then environment variable `CONSUL_HTTP_SSL` to `true`.
|
by setting then environment variable `CONSUL_HTTP_SSL` to `true`.
|
||||||
|
* `datacenter` - (Optional) The datacenter to use. Defaults to that of the agent.
|
||||||
* `http_auth` / `CONSUL_HTTP_AUTH` - (Optional) HTTP Basic Authentication credentials to be used when
|
* `http_auth` / `CONSUL_HTTP_AUTH` - (Optional) HTTP Basic Authentication credentials to be used when
|
||||||
communicating with Consul, in the format of either `user` or `user:pass`.
|
communicating with Consul, in the format of either `user` or `user:pass`.
|
||||||
|
|
Loading…
Reference in New Issue