kube-proxy: rename internal field for clarity

This commit is contained in:
Tim Hockin 2019-01-03 10:23:20 -08:00
parent bfa5876311
commit b3c2888e71

View File

@ -359,7 +359,7 @@ func NewProxier(ipt utiliptables.Interface,
type iptablesJumpChain struct {
table utiliptables.Table
chain utiliptables.Chain
dstChain utiliptables.Chain
sourceChain utiliptables.Chain
comment string
extraArgs []string
@ -388,7 +388,7 @@ func CleanupLeftovers(ipt utiliptables.Interface) (encounteredError bool) {
for _, chain := range append(iptablesJumpChains, iptablesCleanupOnlyChains...) {
args := append(chain.extraArgs,
"-m", "comment", "--comment", chain.comment,
"-j", string(chain.chain),
"-j", string(chain.dstChain),
)
if err := ipt.DeleteRule(chain.table, chain.sourceChain, args...); err != nil {
if !utiliptables.IsNotFoundError(err) {
@ -671,16 +671,16 @@ func (proxier *Proxier) syncProxyRules() {
// Create and link the kube chains.
for _, chain := range iptablesJumpChains {
if _, err := proxier.iptables.EnsureChain(chain.table, chain.chain); err != nil {
if _, err := proxier.iptables.EnsureChain(chain.table, chain.dstChain); err != nil {
klog.Errorf("Failed to ensure that %s chain %s exists: %v", chain.table, kubeServicesChain, err)
return
}
args := append(chain.extraArgs,
"-m", "comment", "--comment", chain.comment,
"-j", string(chain.chain),
"-j", string(chain.dstChain),
)
if _, err := proxier.iptables.EnsureRule(utiliptables.Prepend, chain.table, chain.sourceChain, args...); err != nil {
klog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", chain.table, chain.sourceChain, chain.chain, err)
klog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", chain.table, chain.sourceChain, chain.dstChain, err)
return
}
}