add a reason code to syncProxyRules

This commit is contained in:
Tim Hockin
2017-04-02 22:21:34 -07:00
parent 4d8ffb23ef
commit 92b880c2a9
2 changed files with 15 additions and 9 deletions

View File

@@ -546,7 +546,7 @@ func TestClusterIPReject(t *testing.T) {
svc := proxy.ServicePortName{NamespacedName: types.NamespacedName{Namespace: "ns1", Name: svcName}, Port: "p80"}
fp.serviceMap[svc] = newFakeServiceInfo(svc, svcIP, 80, api.ProtocolTCP, false)
fp.syncProxyRules()
fp.syncProxyRules(syncReasonForce)
svcChain := string(servicePortChainName(svc, strings.ToLower(string(api.ProtocolTCP))))
svcRules := ipt.GetRules(svcChain)
@@ -638,7 +638,7 @@ func TestLoadBalancer(t *testing.T) {
}),
}
fp.syncProxyRules()
fp.syncProxyRules(syncReasonForce)
proto := strings.ToLower(string(api.ProtocolTCP))
fwChain := string(serviceFirewallChainName(svc, proto))
@@ -683,7 +683,7 @@ func TestNodePort(t *testing.T) {
}),
}
fp.syncProxyRules()
fp.syncProxyRules(syncReasonForce)
proto := strings.ToLower(string(api.ProtocolTCP))
svcChain := string(servicePortChainName(svc, strings.ToLower(proto)))
@@ -705,7 +705,7 @@ func TestNodePortReject(t *testing.T) {
svcInfo.nodePort = 3001
fp.serviceMap[svc] = svcInfo
fp.syncProxyRules()
fp.syncProxyRules(syncReasonForce)
kubeSvcRules := ipt.GetRules(string(kubeServicesChain))
if !hasJump(kubeSvcRules, iptablestest.Reject, svcIP.String(), 3001) {