Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request hashicorp#5250 from hashicorp/forward-intention-rpcs
Browse files Browse the repository at this point in the history
connect: Forward intention RPCs if this isn't the primary
  • Loading branch information
kyhavlov authored Jan 22, 2019
2 parents 6b28434 + 88c0447 commit 8851505
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/consul/intention_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8851505

Please sign in to comment.