mirror of https://github.com/status-im/consul.git
Do not include consul as upstream or downstream
This commit is contained in:
parent
3f2489c31d
commit
37f684664d
|
@ -1001,6 +1001,9 @@ func (s *Store) IntentionTopology(ws memdb.WatchSet,
|
||||||
}
|
}
|
||||||
result := make(structs.ServiceList, 0, len(allServices))
|
result := make(structs.ServiceList, 0, len(allServices))
|
||||||
for _, candidate := range allServices {
|
for _, candidate := range allServices {
|
||||||
|
if candidate.Name == structs.ConsulServiceName {
|
||||||
|
continue
|
||||||
|
}
|
||||||
decision, err := s.IntentionDecision(candidate.Name, candidate.NamespaceOrDefault(), intentions, decisionMatchType, defaultDecision, true)
|
decision, err := s.IntentionDecision(candidate.Name, candidate.NamespaceOrDefault(), intentions, decisionMatchType, defaultDecision, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
src, dst := target, candidate
|
src, dst := target, candidate
|
||||||
|
|
|
@ -1889,6 +1889,11 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
Address: "127.0.0.1",
|
Address: "127.0.0.1",
|
||||||
}
|
}
|
||||||
services := []structs.NodeService{
|
services := []structs.NodeService{
|
||||||
|
{
|
||||||
|
ID: structs.ConsulServiceID,
|
||||||
|
Service: structs.ConsulServiceName,
|
||||||
|
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ID: "api-1",
|
ID: "api-1",
|
||||||
Service: "api",
|
Service: "api",
|
||||||
|
@ -1960,7 +1965,7 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
target: structs.NewServiceName("web", nil),
|
target: structs.NewServiceName("web", nil),
|
||||||
downstreams: false,
|
downstreams: false,
|
||||||
expect: expect{
|
expect: expect{
|
||||||
idx: 9,
|
idx: 10,
|
||||||
services: structs.ServiceList{
|
services: structs.ServiceList{
|
||||||
{
|
{
|
||||||
Name: "mysql",
|
Name: "mysql",
|
||||||
|
@ -1987,7 +1992,7 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
target: structs.NewServiceName("web", nil),
|
target: structs.NewServiceName("web", nil),
|
||||||
downstreams: false,
|
downstreams: false,
|
||||||
expect: expect{
|
expect: expect{
|
||||||
idx: 9,
|
idx: 10,
|
||||||
services: structs.ServiceList{
|
services: structs.ServiceList{
|
||||||
{
|
{
|
||||||
Name: "api",
|
Name: "api",
|
||||||
|
@ -2014,7 +2019,7 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
target: structs.NewServiceName("api", nil),
|
target: structs.NewServiceName("api", nil),
|
||||||
downstreams: true,
|
downstreams: true,
|
||||||
expect: expect{
|
expect: expect{
|
||||||
idx: 9,
|
idx: 10,
|
||||||
services: structs.ServiceList{
|
services: structs.ServiceList{
|
||||||
{
|
{
|
||||||
Name: "ingress-gateway",
|
Name: "ingress-gateway",
|
||||||
|
@ -2045,7 +2050,7 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
target: structs.NewServiceName("api", nil),
|
target: structs.NewServiceName("api", nil),
|
||||||
downstreams: true,
|
downstreams: true,
|
||||||
expect: expect{
|
expect: expect{
|
||||||
idx: 9,
|
idx: 10,
|
||||||
services: structs.ServiceList{
|
services: structs.ServiceList{
|
||||||
{
|
{
|
||||||
Name: "web",
|
Name: "web",
|
||||||
|
@ -2072,7 +2077,7 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
target: structs.NewServiceName("web", nil),
|
target: structs.NewServiceName("web", nil),
|
||||||
downstreams: false,
|
downstreams: false,
|
||||||
expect: expect{
|
expect: expect{
|
||||||
idx: 9,
|
idx: 10,
|
||||||
services: structs.ServiceList{
|
services: structs.ServiceList{
|
||||||
{
|
{
|
||||||
Name: "api",
|
Name: "api",
|
||||||
|
@ -2103,7 +2108,7 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
target: structs.NewServiceName("web", nil),
|
target: structs.NewServiceName("web", nil),
|
||||||
downstreams: false,
|
downstreams: false,
|
||||||
expect: expect{
|
expect: expect{
|
||||||
idx: 9,
|
idx: 10,
|
||||||
services: structs.ServiceList{},
|
services: structs.ServiceList{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -2125,7 +2130,7 @@ func TestStore_IntentionTopology(t *testing.T) {
|
||||||
target: structs.NewServiceName("web", nil),
|
target: structs.NewServiceName("web", nil),
|
||||||
downstreams: false,
|
downstreams: false,
|
||||||
expect: expect{
|
expect: expect{
|
||||||
idx: 9,
|
idx: 10,
|
||||||
services: structs.ServiceList{
|
services: structs.ServiceList{
|
||||||
{
|
{
|
||||||
Name: "api",
|
Name: "api",
|
||||||
|
|
Loading…
Reference in New Issue