@@ -19,10 +19,6 @@ limitations under the License.
19
19
20
20
package iptables
21
21
22
- //
23
- // NOTE: this needs to be tested in e2e since it uses iptables for everything.
24
- //
25
-
26
22
import (
27
23
"bytes"
28
24
"context"
@@ -54,7 +50,6 @@ import (
54
50
"k8s.io/kubernetes/pkg/proxy/util/nfacct"
55
51
"k8s.io/kubernetes/pkg/util/async"
56
52
utiliptables "k8s.io/kubernetes/pkg/util/iptables"
57
- utilexec "k8s.io/utils/exec"
58
53
)
59
54
60
55
const (
@@ -101,7 +96,6 @@ func NewDualStackProxier(
101
96
ctx context.Context ,
102
97
ipt [2 ]utiliptables.Interface ,
103
98
sysctl utilsysctl.Interface ,
104
- exec utilexec.Interface ,
105
99
syncPeriod time.Duration ,
106
100
minSyncPeriod time.Duration ,
107
101
masqueradeAll bool ,
@@ -117,15 +111,15 @@ func NewDualStackProxier(
117
111
) (proxy.Provider , error ) {
118
112
// Create an ipv4 instance of the single-stack proxier
119
113
ipv4Proxier , err := NewProxier (ctx , v1 .IPv4Protocol , ipt [0 ], sysctl ,
120
- exec , syncPeriod , minSyncPeriod , masqueradeAll , localhostNodePorts , masqueradeBit ,
114
+ syncPeriod , minSyncPeriod , masqueradeAll , localhostNodePorts , masqueradeBit ,
121
115
localDetectors [v1 .IPv4Protocol ], hostname , nodeIPs [v1 .IPv4Protocol ],
122
116
recorder , healthzServer , nodePortAddresses , initOnly )
123
117
if err != nil {
124
118
return nil , fmt .Errorf ("unable to create ipv4 proxier: %v" , err )
125
119
}
126
120
127
121
ipv6Proxier , err := NewProxier (ctx , v1 .IPv6Protocol , ipt [1 ], sysctl ,
128
- exec , syncPeriod , minSyncPeriod , masqueradeAll , false , masqueradeBit ,
122
+ syncPeriod , minSyncPeriod , masqueradeAll , false , masqueradeBit ,
129
123
localDetectors [v1 .IPv6Protocol ], hostname , nodeIPs [v1 .IPv6Protocol ],
130
124
recorder , healthzServer , nodePortAddresses , initOnly )
131
125
if err != nil {
@@ -137,8 +131,7 @@ func NewDualStackProxier(
137
131
return metaproxier .NewMetaProxier (ipv4Proxier , ipv6Proxier ), nil
138
132
}
139
133
140
- // Proxier is an iptables based proxy for connections between a localhost:lport
141
- // and services that provide the actual backends.
134
+ // Proxier is an iptables-based proxy
142
135
type Proxier struct {
143
136
// ipFamily defines the IP family which this proxier is tracking.
144
137
ipFamily v1.IPFamily
@@ -175,7 +168,6 @@ type Proxier struct {
175
168
localDetector proxyutil.LocalTrafficDetector
176
169
hostname string
177
170
nodeIP net.IP
178
- recorder events.EventRecorder
179
171
180
172
serviceHealthServer healthcheck.ServiceHealthServer
181
173
healthzServer * healthcheck.ProxyHealthServer
@@ -221,16 +213,11 @@ type Proxier struct {
221
213
// Proxier implements proxy.Provider
222
214
var _ proxy.Provider = & Proxier {}
223
215
224
- // NewProxier returns a new Proxier given an iptables Interface instance.
225
- // Because of the iptables logic, it is assumed that there is only a single Proxier active on a machine.
226
- // An error will be returned if iptables fails to update or acquire the initial lock.
227
- // Once a proxier is created, it will keep iptables up to date in the background and
228
- // will not terminate if a particular iptables call fails.
216
+ // NewProxier returns a new single-stack IPTables proxier.
229
217
func NewProxier (ctx context.Context ,
230
218
ipFamily v1.IPFamily ,
231
219
ipt utiliptables.Interface ,
232
220
sysctl utilsysctl.Interface ,
233
- exec utilexec.Interface ,
234
221
syncPeriod time.Duration ,
235
222
minSyncPeriod time.Duration ,
236
223
masqueradeAll bool ,
@@ -300,7 +287,6 @@ func NewProxier(ctx context.Context,
300
287
localDetector : localDetector ,
301
288
hostname : hostname ,
302
289
nodeIP : nodeIP ,
303
- recorder : recorder ,
304
290
serviceHealthServer : serviceHealthServer ,
305
291
healthzServer : healthzServer ,
306
292
precomputedProbabilities : make ([]string , 0 , 1001 ),
0 commit comments