Skip to content

Commit

Permalink
connect: Forward intention RPCs if this isn't the primary
Browse files Browse the repository at this point in the history
  • Loading branch information
kyhavlov committed Jan 22, 2019
1 parent 6b28434 commit 88c0447
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/consul/intention_endpoint.go
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 88c0447

Please sign in to comment.