From 8dd6270f208ce449ec69140a2b7103d8190189cc Mon Sep 17 00:00:00 2001 From: Jana Radhakrishnan Date: Mon, 3 Oct 2016 15:15:09 -0700 Subject: [PATCH] Do not add names to ingress network Do not add service discovery names to ingress network as this is a routing only network and no intra-cluster discovery should happen in that network. This fixes the ambiguity and resolving names between services which are both publishing ports and also attached to same another network. Signed-off-by: Jana Radhakrishnan --- network.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/network.go b/network.go index 6b35bc628b..4901c91bc7 100644 --- a/network.go +++ b/network.go @@ -1059,6 +1059,12 @@ func delNameToIP(svcMap map[string][]net.IP, name string, epIP net.IP) { } func (n *network) addSvcRecords(name string, epIP net.IP, epIPv6 net.IP, ipMapUpdate bool) { + // Do not add service names for ingress network as this is a + // routing only network + if n.ingress { + return + } + c := n.getController() c.Lock() defer c.Unlock() @@ -1086,6 +1092,12 @@ func (n *network) addSvcRecords(name string, epIP net.IP, epIPv6 net.IP, ipMapUp } func (n *network) deleteSvcRecords(name string, epIP net.IP, epIPv6 net.IP, ipMapUpdate bool) { + // Do not delete service names from ingress network as this is a + // routing only network + if n.ingress { + return + } + c := n.getController() c.Lock() defer c.Unlock()