|
|
@ -13,6 +13,7 @@ import ( |
|
|
|
"google.golang.org/grpc" |
|
|
|
"google.golang.org/grpc" |
|
|
|
"google.golang.org/grpc/codes" |
|
|
|
"google.golang.org/grpc/codes" |
|
|
|
grpcstatus "google.golang.org/grpc/status" |
|
|
|
grpcstatus "google.golang.org/grpc/status" |
|
|
|
|
|
|
|
"google.golang.org/protobuf/proto" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/acl" |
|
|
|
"github.com/hashicorp/consul/acl" |
|
|
|
"github.com/hashicorp/consul/agent/consul/state" |
|
|
|
"github.com/hashicorp/consul/agent/consul/state" |
|
|
@ -610,22 +611,13 @@ func (s *Server) getExistingOrCreateNewPeerID(peerName, partition string) (strin |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func copyPeeringWith(p *pbpeering.Peering, state pbpeering.PeeringState, isc, esc uint64) *pbpeering.Peering { |
|
|
|
func copyPeeringWith(p *pbpeering.Peering, state pbpeering.PeeringState, isc, esc uint64) *pbpeering.Peering { |
|
|
|
return &pbpeering.Peering{ |
|
|
|
var copyP pbpeering.Peering |
|
|
|
ID: p.ID, |
|
|
|
proto.Merge(©P, p) |
|
|
|
Name: p.Name, |
|
|
|
|
|
|
|
Partition: p.Partition, |
|
|
|
// add new state, imported & exported services counts
|
|
|
|
DeletedAt: p.DeletedAt, |
|
|
|
copyP.State = state |
|
|
|
Meta: p.Meta, |
|
|
|
copyP.ImportedServiceCount = isc |
|
|
|
PeerID: p.PeerID, |
|
|
|
copyP.ExportedServiceCount = esc |
|
|
|
PeerCAPems: p.PeerCAPems, |
|
|
|
|
|
|
|
PeerServerAddresses: p.PeerServerAddresses, |
|
|
|
return ©P |
|
|
|
PeerServerName: p.PeerServerName, |
|
|
|
|
|
|
|
CreateIndex: p.CreateIndex, |
|
|
|
|
|
|
|
ModifyIndex: p.ModifyIndex, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImportedServiceCount: isc, |
|
|
|
|
|
|
|
ExportedServiceCount: esc, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
State: state, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|