From 0e6f0736cea3711184b7f558355e97543d71c72d Mon Sep 17 00:00:00 2001 From: Hong Zhiguo Date: Wed, 27 Jun 2018 22:17:21 +0800 Subject: [PATCH] ipvs: remove duplicated masq rules Duplicated masq rules are created by current implementation: -A KUBE-NODE-PORT -m comment --comment "mark MASQ for externaltrafficpolicy=cluster" -j KUBE-MARK-MASQ -A KUBE-NODE-PORT -j KUBE-MARK-MASQ The last one is always there. So the one inside if statement could just be removed. --- pkg/proxy/ipvs/proxier.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index dbbc505cb80..35ba52d0864 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -1283,13 +1283,6 @@ func (proxier *Proxier) writeIptablesRules() { ) writeLine(proxier.natRules, append(args, "-j", "ACCEPT")...) } - // mark masq for others - args = append(args[:0], - "-A", string(KubeNodePortChain), - "-m", "comment", "--comment", - fmt.Sprintf(`"mark MASQ for externaltrafficpolicy=cluster"`), - ) - writeLine(proxier.natRules, append(args, "-j", string(KubeMarkMasqChain))...) } // mark masq for KUBE-NODE-PORT