Merge pull request #5250 from hashicorp/forward-intention-rpcs

connect: Forward intention RPCs if this isn't the primary
This commit is contained in:
Kyle Havlovitz 2019-01-22 11:32:55 -08:00 committed by GitHub
commit e0baa68681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@ type Intention struct {
func (s *Intention) Apply(
args *structs.IntentionRequest,
reply *string) error {
// Forward this request to the primary DC if we're a secondary that's replicating intentions.
if s.srv.intentionReplicationEnabled() {
args.Datacenter = s.srv.config.PrimaryDatacenter
}
if done, err := s.srv.forward("Intention.Apply", args, args, reply); done {
return err
}