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").
This commit is contained in:
Dan Winship 2024-12-15 10:49:39 -05:00
parent b5e9a8262e
commit 303593cafe
4 changed files with 8 additions and 29 deletions

View File

@ -19,10 +19,6 @@ limitations under the License.
package iptables
//
// NOTE: this needs to be tested in e2e since it uses iptables for everything.
//
import (
"bytes"
"context"
@ -135,8 +131,7 @@ func NewDualStackProxier(
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
}
// Proxier is an iptables based proxy for connections between a localhost:lport
// and services that provide the actual backends.
// Proxier is an iptables-based proxy
type Proxier struct {
// ipFamily defines the IP family which this proxier is tracking.
ipFamily v1.IPFamily
@ -218,11 +213,7 @@ type Proxier struct {
// Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{}
// NewProxier returns a new Proxier given an iptables Interface instance.
// Because of the iptables logic, it is assumed that there is only a single Proxier active on a machine.
// An error will be returned if iptables fails to update or acquire the initial lock.
// Once a proxier is created, it will keep iptables up to date in the background and
// will not terminate if a particular iptables call fails.
// NewProxier returns a new single-stack IPTables proxier.
func NewProxier(ctx context.Context,
ipFamily v1.IPFamily,
ipt utiliptables.Interface,

View File

@ -159,8 +159,7 @@ func NewDualStackProxier(
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
}
// Proxier is an ipvs based proxy for connections between a localhost:lport
// and services that provide the actual backends.
// Proxier is an ipvs-based proxy
type Proxier struct {
// the ipfamily on which this proxy is operating on.
ipFamily v1.IPFamily
@ -254,11 +253,7 @@ type Proxier struct {
// Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{}
// NewProxier returns a new Proxier given an iptables and ipvs Interface instance.
// Because of the iptables and ipvs logic, it is assumed that there is only a single Proxier active on a machine.
// An error will be returned if it fails to update or acquire the initial lock.
// Once a proxier is created, it will keep iptables and ipvs rules up to date in the background and
// will not terminate if a particular iptables or ipvs call fails.
// NewProxier returns a new single-stack IPVS proxier.
func NewProxier(
ctx context.Context,
ipFamily v1.IPFamily,

View File

@ -19,10 +19,6 @@ limitations under the License.
package nftables
//
// NOTE: this needs to be tested in e2e since it uses nftables for everything.
//
import (
"context"
"crypto/sha256"
@ -143,7 +139,7 @@ func NewDualStackProxier(
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
}
// Proxier is an nftables based proxy
// Proxier is an nftables-based proxy
type Proxier struct {
// ipFamily defines the IP family which this proxier is tracking.
ipFamily v1.IPFamily
@ -211,9 +207,7 @@ type Proxier struct {
// Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{}
// NewProxier returns a new nftables Proxier. Once a proxier is created, it will keep
// nftables up to date in the background and will not terminate if a particular nftables
// call fails.
// NewProxier returns a new single-stack NFTables proxier.
func NewProxier(ctx context.Context,
ipFamily v1.IPFamily,
syncPeriod time.Duration,

View File

@ -623,8 +623,7 @@ func (network hnsNetworkInfo) findRemoteSubnetProviderAddress(ip string) string
type endPointsReferenceCountMap map[string]*uint16
// Proxier is an hns based proxy for connections between a localhost:lport
// and services that provide the actual backends.
// Proxier is an HNS-based proxy
type Proxier struct {
// ipFamily defines the IP family which this proxier is tracking.
ipFamily v1.IPFamily
@ -701,7 +700,7 @@ type closeable interface {
// Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{}
// NewProxier returns a new Proxier
// NewProxier returns a new single-stack winkernel proxier.
func NewProxier(
ipFamily v1.IPFamily,
syncPeriod time.Duration,