Skip to content

Commit

Permalink
proxycfg: use external addresses in tproxy when crossing partition bo…
Browse files Browse the repository at this point in the history
…undaries (#11823)
  • Loading branch information
rboyer authored and hc-github-team-consul-core committed Dec 13, 2021
1 parent a89d859 commit ac4daf1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agent/proxycfg/upstreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ func (s *handlerUpstreams) handleUpdateUpstreams(ctx context.Context, u cache.Up
}
}

// TODO(partitions) Update to account for upstream in remote partition once tproxy supports it
addr, _ := node.BestAddress(false)
// Make sure to use an external address when crossing partitions.
isRemote := !structs.EqualPartitions(svc.PartitionOrDefault(), s.proxyID.PartitionOrDefault())
addr, _ := node.BestAddress(isRemote)

upstreamsSnapshot.PassthroughUpstreams[svc.String()].Addrs[addr] = struct{}{}
}
}
Expand Down

0 comments on commit ac4daf1

Please sign in to comment.