fix: shadowed err in retryJoin() (#14112)

- err value will be used later to surface the error message
  if r.join() returns any err.
This commit is contained in:
cskh 2022-08-10 10:53:57 -04:00 committed by GitHub
parent 79c23a7cd2
commit 11e7a0d547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -226,7 +226,8 @@ func (r *retryJoiner) retryJoin() error {
for { for {
addrs := retryJoinAddrs(disco, r.variant, r.cluster, r.addrs, r.logger) addrs := retryJoinAddrs(disco, r.variant, r.cluster, r.addrs, r.logger)
if len(addrs) > 0 { if len(addrs) > 0 {
n, err := r.join(addrs) n := 0
n, err = r.join(addrs)
if err == nil { if err == nil {
if r.variant == retryJoinMeshGatewayVariant { if r.variant == retryJoinMeshGatewayVariant {
r.logger.Info("Refreshing mesh gateways completed") r.logger.Info("Refreshing mesh gateways completed")