diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-03-27 09:42:44 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-03-30 10:41:13 +0300 |
commit | 9aa2a59502df920a2a2869f61a5be420e0bf8a35 (patch) | |
tree | 849f9c09699439948b16da601931b06c361f4d57 | |
parent | d44116a50e52335d009a2b47ff63ca7a7ca9720a (diff) |
balancer: silence deprecation warnings
There are currently two deprecation warnings related to gRPC in the
balancer code for `conn.NewAddress()` and `conn.NewServiceConfig()`
which should both be replaced with calls to `conn.UpdateState()`
instead. The issue with `UpdateState()` though is that you can only
replace the complete state, that is both address and configuration, at
the same time. As we do not have both pieces of information ready when
calling `NewAddress()` and `NewServiceConfig()`, let's silence those
warnings for now to allow the linter to become warning-free.
-rw-r--r-- | internal/rubyserver/balancer/balancer.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/rubyserver/balancer/balancer.go b/internal/rubyserver/balancer/balancer.go index e978c29e9..abd722530 100644 --- a/internal/rubyserver/balancer/balancer.go +++ b/internal/rubyserver/balancer/balancer.go @@ -121,6 +121,7 @@ func (*builder) Scheme() string { return Scheme } // care what "address" the caller wants to resolve. We always resolve to // the current list of address for local gitaly-ruby processes. func (b *builder) Build(_ resolver.Target, cc resolver.ClientConn, _ resolver.BuildOption) (resolver.Resolver, error) { + //nolint:golint // There is no obvious way to use UpdateState() without completely replacing the current configuration cc.NewServiceConfig(`{"LoadBalancingPolicy":"round_robin"}`) return newGitalyResolver(cc, b.addressUpdates), nil } @@ -243,6 +244,7 @@ func (r *gitalyResolver) monitor() { func (r *gitalyResolver) sendUpdate() chan struct{} { au := <-r.addressUpdates + //nolint:golint // There is no obvious way to use UpdateState() without completely replacing the current configuration r.clientConn.NewAddress(au.addrs) return au.next } |