Merge pull request #9851 from hashicorp/b-proxy-default-connect-timeout
consul/connect: always set gateway proxy default timeout
This commit is contained in:
commit
1bebf475c6
|
@ -2,6 +2,7 @@
|
|||
|
||||
BUG FIXES:
|
||||
|
||||
* consul/connect: Fixed a bug where gateway proxy connection default timeout not set [[GH-9851](https://github.com/hashicorp/nomad/pull/9851)]
|
||||
* scheduler: Fixed a bug where shared ports were not persisted during inplace updates for service jobs. [[GH-9830](https://github.com/hashicorp/nomad/issues/9830)]
|
||||
|
||||
## 1.0.2 (January 14, 2020)
|
||||
|
|
|
@ -335,6 +335,8 @@ type ConsulGatewayBindAddress struct {
|
|||
}
|
||||
|
||||
var (
|
||||
// defaultConnectTimeout is the default amount of time a connect gateway will
|
||||
// wait for a response from an upstream service (same as consul)
|
||||
defaultGatewayConnectTimeout = 5 * time.Second
|
||||
)
|
||||
|
||||
|
|
|
@ -12,6 +12,12 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
// defaultConnectTimeout is the default amount of time a connect gateway will
|
||||
// wait for a response from an upstream service (same as consul)
|
||||
defaultConnectTimeout = 5 * time.Second
|
||||
)
|
||||
|
||||
var (
|
||||
// connectSidecarResources returns the set of resources used by default for
|
||||
// the Consul Connect sidecar task
|
||||
|
@ -324,6 +330,11 @@ func gatewayProxyForBridge(gateway *structs.ConsulGateway) *structs.ConsulGatewa
|
|||
proxy.Config = gateway.Proxy.Config
|
||||
}
|
||||
|
||||
// set default connect timeout if not set
|
||||
if proxy.ConnectTimeout == nil {
|
||||
proxy.ConnectTimeout = helper.TimeToPtr(defaultConnectTimeout)
|
||||
}
|
||||
|
||||
// magically set the fields where Nomad knows what to do
|
||||
proxy.EnvoyGatewayNoDefaultBind = true
|
||||
proxy.EnvoyGatewayBindTaggedAddresses = false
|
||||
|
|
|
@ -492,6 +492,7 @@ func TestJobEndpointConnect_gatewayProxyForBridge(t *testing.T) {
|
|||
},
|
||||
})
|
||||
require.Equal(t, &structs.ConsulGatewayProxy{
|
||||
ConnectTimeout: helper.TimeToPtr(defaultConnectTimeout),
|
||||
EnvoyGatewayNoDefaultBind: true,
|
||||
EnvoyGatewayBindTaggedAddresses: false,
|
||||
EnvoyGatewayBindAddresses: map[string]*structs.ConsulGatewayBindAddress{
|
||||
|
|
2
vendor/github.com/hashicorp/nomad/api/services.go
generated
vendored
2
vendor/github.com/hashicorp/nomad/api/services.go
generated
vendored
|
@ -335,6 +335,8 @@ type ConsulGatewayBindAddress struct {
|
|||
}
|
||||
|
||||
var (
|
||||
// defaultConnectTimeout is the default amount of time a connect gateway will
|
||||
// wait for a response from an upstream service (same as consul)
|
||||
defaultGatewayConnectTimeout = 5 * time.Second
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue