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 package iptables
//
// NOTE: this needs to be tested in e2e since it uses iptables for everything.
//
import ( import (
"bytes" "bytes"
"context" "context"
@ -135,8 +131,7 @@ func NewDualStackProxier(
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
} }
// Proxier is an iptables based proxy for connections between a localhost:lport // Proxier is an iptables-based proxy
// and services that provide the actual backends.
type Proxier struct { type Proxier struct {
// ipFamily defines the IP family which this proxier is tracking. // ipFamily defines the IP family which this proxier is tracking.
ipFamily v1.IPFamily ipFamily v1.IPFamily
@ -218,11 +213,7 @@ type Proxier struct {
// Proxier implements proxy.Provider // Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{} var _ proxy.Provider = &Proxier{}
// NewProxier returns a new Proxier given an iptables Interface instance. // NewProxier returns a new single-stack IPTables proxier.
// 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.
func NewProxier(ctx context.Context, func NewProxier(ctx context.Context,
ipFamily v1.IPFamily, ipFamily v1.IPFamily,
ipt utiliptables.Interface, ipt utiliptables.Interface,

View File

@ -159,8 +159,7 @@ func NewDualStackProxier(
return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil return metaproxier.NewMetaProxier(ipv4Proxier, ipv6Proxier), nil
} }
// Proxier is an ipvs based proxy for connections between a localhost:lport // Proxier is an ipvs-based proxy
// and services that provide the actual backends.
type Proxier struct { type Proxier struct {
// the ipfamily on which this proxy is operating on. // the ipfamily on which this proxy is operating on.
ipFamily v1.IPFamily ipFamily v1.IPFamily
@ -254,11 +253,7 @@ type Proxier struct {
// Proxier implements proxy.Provider // Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{} var _ proxy.Provider = &Proxier{}
// NewProxier returns a new Proxier given an iptables and ipvs Interface instance. // NewProxier returns a new single-stack IPVS proxier.
// 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.
func NewProxier( func NewProxier(
ctx context.Context, ctx context.Context,
ipFamily v1.IPFamily, ipFamily v1.IPFamily,

View File

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

View File

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