Skip to content

Commit

Permalink
BUILD: Update Consul APIs to 1.4.0 and Consul to 1.7.2 (#28)
Browse files Browse the repository at this point in the history
This will allow to have the same code in:
hashicorp/consul#7637

And will fix #19
  • Loading branch information
pierresouchay authored Apr 17, 2020
1 parent b7a9eb8 commit 210ea5c
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 8 deletions.
6 changes: 3 additions & 3 deletions consul/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ func (w *Watcher) handleProxyChange(first bool, srv *api.AgentService) {
w.downstream.LocalBindAddress = defaultDownstreamBindAddr
w.downstream.LocalBindPort = srv.Port
w.downstream.TargetAddress = defaultUpstreamBindAddr
if srv.Connect != nil && srv.Connect.Proxy != nil && srv.Connect.Proxy.Config != nil {
if b, ok := srv.Connect.Proxy.Config["bind_address"].(string); ok {
if srv.Connect != nil && srv.Connect.SidecarService != nil && srv.Connect.SidecarService.Proxy != nil && srv.Connect.SidecarService.Proxy.Config != nil {
if b, ok := srv.Connect.SidecarService.Proxy.Config["bind_address"].(string); ok {
w.downstream.LocalBindAddress = b
}
if a, ok := srv.Connect.Proxy.Config["local_service_address"].(string); ok {
if a, ok := srv.Connect.SidecarService.Proxy.Config["local_service_address"].(string); ok {
w.downstream.TargetAddress = a
}
}
Expand Down
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ require (
github.com/go-openapi/runtime v0.19.0 // indirect
github.com/go-openapi/spec v0.19.0 // indirect
github.com/haproxytech/models v1.2.0
github.com/hashicorp/consul v1.5.1
github.com/hashicorp/consul/api v1.1.0
github.com/hashicorp/consul v1.7.2
github.com/hashicorp/consul/api v1.4.0
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 // indirect
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.0.0-20180328130430-f504d69affe1
github.com/prometheus/client_golang v0.9.2
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.4.0
golang.org/x/net v0.0.0-20190607181551-461777fb6f67 // indirect
golang.org/x/sys v0.0.0-20190528012530-adf421d2caf4 // indirect
golang.org/x/text v0.3.2 // indirect
gopkg.in/d4l3k/messagediff.v1 v1.2.1
gopkg.in/mcuadros/go-syslog.v2 v2.2.1
Expand Down
Loading

0 comments on commit 210ea5c

Please sign in to comment.