Skip to content

Commit 303593c

Browse files
committed
Fix some pkg/proxy comments
Remove a bunch of comments that are either inaccurate ("the proxier can only be tested by e2e tests") or weirdly overspecific about obvious details ("the proxier will not exit if an iptables call fails").
1 parent b5e9a82 commit 303593c

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

pkg/proxy/iptables/proxier.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ limitations under the License.
1919

2020
package iptables
2121

22-
//
23-
// NOTE: this needs to be tested in e2e since it uses iptables for everything.
24-
//
25-
2622
import (
2723
"bytes"
2824
"context"
@@ -135,8 +131,7 @@ func NewDualStackProxier(
135131
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
136132
}
137133

138-
// Proxier is an iptables based proxy for connections between a localhost:lport
139-
// and services that provide the actual backends.
134+
// Proxier is an iptables-based proxy
140135
type Proxier struct {
141136
// ipFamily defines the IP family which this proxier is tracking.
142137
ipFamily v1.IPFamily
@@ -218,11 +213,7 @@ type Proxier struct {
218213
// Proxier implements proxy.Provider
219214
var _ proxy.Provider = &Proxier{}
220215

221-
// NewProxier returns a new Proxier given an iptables Interface instance.
222-
// Because of the iptables logic, it is assumed that there is only a single Proxier active on a machine.
223-
// An error will be returned if iptables fails to update or acquire the initial lock.
224-
// Once a proxier is created, it will keep iptables up to date in the background and
225-
// will not terminate if a particular iptables call fails.
216+
// NewProxier returns a new single-stack IPTables proxier.
226217
func NewProxier(ctx context.Context,
227218
ipFamily v1.IPFamily,
228219
ipt utiliptables.Interface,

pkg/proxy/ipvs/proxier.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ func NewDualStackProxier(
159159
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
160160
}
161161

162-
// Proxier is an ipvs based proxy for connections between a localhost:lport
163-
// and services that provide the actual backends.
162+
// Proxier is an ipvs-based proxy
164163
type Proxier struct {
165164
// the ipfamily on which this proxy is operating on.
166165
ipFamily v1.IPFamily
@@ -254,11 +253,7 @@ type Proxier struct {
254253
// Proxier implements proxy.Provider
255254
var _ proxy.Provider = &Proxier{}
256255

257-
// NewProxier returns a new Proxier given an iptables and ipvs Interface instance.
258-
// Because of the iptables and ipvs logic, it is assumed that there is only a single Proxier active on a machine.
259-
// An error will be returned if it fails to update or acquire the initial lock.
260-
// Once a proxier is created, it will keep iptables and ipvs rules up to date in the background and
261-
// will not terminate if a particular iptables or ipvs call fails.
256+
// NewProxier returns a new single-stack IPVS proxier.
262257
func NewProxier(
263258
ctx context.Context,
264259
ipFamily v1.IPFamily,

pkg/proxy/nftables/proxier.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ limitations under the License.
1919

2020
package nftables
2121

22-
//
23-
// NOTE: this needs to be tested in e2e since it uses nftables for everything.
24-
//
25-
2622
import (
2723
"context"
2824
"crypto/sha256"
@@ -143,7 +139,7 @@ func NewDualStackProxier(
143139
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
144140
}
145141

146-
// Proxier is an nftables based proxy
142+
// Proxier is an nftables-based proxy
147143
type Proxier struct {
148144
// ipFamily defines the IP family which this proxier is tracking.
149145
ipFamily v1.IPFamily
@@ -211,9 +207,7 @@ type Proxier struct {
211207
// Proxier implements proxy.Provider
212208
var _ proxy.Provider = &Proxier{}
213209

214-
// NewProxier returns a new nftables Proxier. Once a proxier is created, it will keep
215-
// nftables up to date in the background and will not terminate if a particular nftables
216-
// call fails.
210+
// NewProxier returns a new single-stack NFTables proxier.
217211
func NewProxier(ctx context.Context,
218212
ipFamily v1.IPFamily,
219213
syncPeriod time.Duration,

pkg/proxy/winkernel/proxier.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,7 @@ func (network hnsNetworkInfo) findRemoteSubnetProviderAddress(ip string) string
623623

624624
type endPointsReferenceCountMap map[string]*uint16
625625

626-
// Proxier is an hns based proxy for connections between a localhost:lport
627-
// and services that provide the actual backends.
626+
// Proxier is an HNS-based proxy
628627
type Proxier struct {
629628
// ipFamily defines the IP family which this proxier is tracking.
630629
ipFamily v1.IPFamily
@@ -701,7 +700,7 @@ type closeable interface {
701700
// Proxier implements proxy.Provider
702701
var _ proxy.Provider = &Proxier{}
703702

704-
// NewProxier returns a new Proxier
703+
// NewProxier returns a new single-stack winkernel proxier.
705704
func NewProxier(
706705
ipFamily v1.IPFamily,
707706
syncPeriod time.Duration,

0 commit comments

Comments
 (0)