diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index fbde2f8db8b..846a7ec6ff3 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -265,6 +265,7 @@ func NewProxier(ipFamily v1.IPFamily, serviceChanges: proxy.NewServiceChangeTracker(newServiceInfo, ipFamily, recorder, nil), endpointsMap: make(proxy.EndpointsMap), endpointsChanges: proxy.NewEndpointChangeTracker(hostname, newEndpointInfo, ipFamily, recorder, nil), + needFullSync: true, syncPeriod: syncPeriod, iptables: ipt, masqueradeAll: masqueradeAll, @@ -538,7 +539,7 @@ func (proxier *Proxier) OnServiceSynced() { proxier.mu.Unlock() // Sync unconditionally - this is called once per lifetime. - proxier.forceSyncProxyRules() + proxier.syncProxyRules() } // OnEndpointSliceAdd is called whenever creation of a new endpoint slice object @@ -574,7 +575,7 @@ func (proxier *Proxier) OnEndpointSlicesSynced() { proxier.mu.Unlock() // Sync unconditionally - this is called once per lifetime. - proxier.forceSyncProxyRules() + proxier.syncProxyRules() } // OnNodeAdd is called whenever creation of new node object diff --git a/pkg/proxy/iptables/proxier_test.go b/pkg/proxy/iptables/proxier_test.go index 6b050a14713..18590faf914 100644 --- a/pkg/proxy/iptables/proxier_test.go +++ b/pkg/proxy/iptables/proxier_test.go @@ -408,6 +408,7 @@ func NewFakeProxier(ipt utiliptables.Interface) *Proxier { serviceChanges: proxy.NewServiceChangeTracker(newServiceInfo, ipfamily, nil, nil), endpointsMap: make(proxy.EndpointsMap), endpointsChanges: proxy.NewEndpointChangeTracker(testHostname, newEndpointInfo, ipfamily, nil, nil), + needFullSync: true, iptables: ipt, masqueradeMark: "0x4000", localDetector: detectLocal,