mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #79846 from aramase/fix-golint-pkg/proxy
Fix golint failures in pkg/proxy
This commit is contained in:
commit
9c736445f5
@ -465,7 +465,7 @@ type ProxyServer struct {
|
|||||||
IpvsInterface utilipvs.Interface
|
IpvsInterface utilipvs.Interface
|
||||||
IpsetInterface utilipset.Interface
|
IpsetInterface utilipset.Interface
|
||||||
execer exec.Interface
|
execer exec.Interface
|
||||||
Proxier proxy.ProxyProvider
|
Proxier proxy.Provider
|
||||||
Broadcaster record.EventBroadcaster
|
Broadcaster record.EventBroadcaster
|
||||||
Recorder record.EventRecorder
|
Recorder record.EventRecorder
|
||||||
ConntrackConfiguration kubeproxyconfig.KubeProxyConntrackConfiguration
|
ConntrackConfiguration kubeproxyconfig.KubeProxyConntrackConfiguration
|
||||||
|
@ -131,7 +131,7 @@ func newProxyServer(
|
|||||||
healthzUpdater = healthzServer
|
healthzUpdater = healthzServer
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxier proxy.ProxyProvider
|
var proxier proxy.Provider
|
||||||
|
|
||||||
proxyMode := getProxyMode(string(config.Mode), kernelHandler, ipsetInterface, iptables.LinuxKernelCompatTester{})
|
proxyMode := getProxyMode(string(config.Mode), kernelHandler, ipsetInterface, iptables.LinuxKernelCompatTester{})
|
||||||
nodeIP := net.ParseIP(config.BindAddress)
|
nodeIP := net.ParseIP(config.BindAddress)
|
||||||
|
@ -94,7 +94,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
|
|||||||
healthzUpdater = healthzServer
|
healthzUpdater = healthzServer
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxier proxy.ProxyProvider
|
var proxier proxy.Provider
|
||||||
|
|
||||||
proxyMode := getProxyMode(string(config.Mode), winkernel.WindowsKernelCompatTester{})
|
proxyMode := getProxyMode(string(config.Mode), winkernel.WindowsKernelCompatTester{})
|
||||||
if proxyMode == proxyModeKernelspace {
|
if proxyMode == proxyModeKernelspace {
|
||||||
|
@ -141,7 +141,6 @@ pkg/kubemark
|
|||||||
pkg/master
|
pkg/master
|
||||||
pkg/master/controller/crdregistration
|
pkg/master/controller/crdregistration
|
||||||
pkg/master/tunneler
|
pkg/master/tunneler
|
||||||
pkg/proxy
|
|
||||||
pkg/proxy/apis/config
|
pkg/proxy/apis/config
|
||||||
pkg/proxy/apis/config/v1alpha1
|
pkg/proxy/apis/config/v1alpha1
|
||||||
pkg/proxy/userspace
|
pkg/proxy/userspace
|
||||||
|
@ -70,7 +70,7 @@ func NewHollowProxyOrDie(
|
|||||||
proxierMinSyncPeriod time.Duration,
|
proxierMinSyncPeriod time.Duration,
|
||||||
) (*HollowProxy, error) {
|
) (*HollowProxy, error) {
|
||||||
// Create proxier and service/endpoint handlers.
|
// Create proxier and service/endpoint handlers.
|
||||||
var proxier proxy.ProxyProvider
|
var proxier proxy.Provider
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if useRealProxier {
|
if useRealProxier {
|
||||||
|
@ -205,7 +205,7 @@ type UpdateEndpointMapResult struct {
|
|||||||
LastChangeTriggerTimes []time.Time
|
LastChangeTriggerTimes []time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateEndpointsMap updates endpointsMap base on the given changes.
|
// Update updates endpointsMap base on the given changes.
|
||||||
func (em EndpointsMap) Update(changes *EndpointChangeTracker) (result UpdateEndpointMapResult) {
|
func (em EndpointsMap) Update(changes *EndpointChangeTracker) (result UpdateEndpointMapResult) {
|
||||||
result.StaleEndpoints = make([]ServiceEndpoint, 0)
|
result.StaleEndpoints = make([]ServiceEndpoint, 0)
|
||||||
result.StaleServiceNames = make([]ServicePortName, 0)
|
result.StaleServiceNames = make([]ServicePortName, 0)
|
||||||
|
@ -235,8 +235,8 @@ func (l *listenPortOpener) OpenLocalPort(lp *utilproxy.LocalPort) (utilproxy.Clo
|
|||||||
return openLocalPort(lp)
|
return openLocalPort(lp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Proxier implements ProxyProvider
|
// Proxier implements proxy.Provider
|
||||||
var _ proxy.ProxyProvider = &Proxier{}
|
var _ proxy.Provider = &Proxier{}
|
||||||
|
|
||||||
// NewProxier returns a new Proxier given an iptables Interface instance.
|
// 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.
|
// Because of the iptables logic, it is assumed that there is only a single Proxier active on a machine.
|
||||||
|
@ -273,8 +273,8 @@ func (r *realIPGetter) NodeIPs() (ips []net.IP, err error) {
|
|||||||
return ips, nil
|
return ips, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Proxier implements ProxyProvider
|
// Proxier implements proxy.Provider
|
||||||
var _ proxy.ProxyProvider = &Proxier{}
|
var _ proxy.Provider = &Proxier{}
|
||||||
|
|
||||||
// parseExcludedCIDRs parses the input strings and returns net.IPNet
|
// parseExcludedCIDRs parses the input strings and returns net.IPNet
|
||||||
// The validation has been done earlier so the error condition will never happen under normal conditions
|
// The validation has been done earlier so the error condition will never happen under normal conditions
|
||||||
|
@ -25,12 +25,12 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/proxy/config"
|
"k8s.io/kubernetes/pkg/proxy/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProxyProvider is the interface provided by proxier implementations.
|
// Provider is the interface provided by proxier implementations.
|
||||||
type ProxyProvider interface {
|
type Provider interface {
|
||||||
config.EndpointsHandler
|
config.EndpointsHandler
|
||||||
config.ServiceHandler
|
config.ServiceHandler
|
||||||
|
|
||||||
// Sync immediately synchronizes the ProxyProvider's current state to proxy rules.
|
// Sync immediately synchronizes the Provider's current state to proxy rules.
|
||||||
Sync()
|
Sync()
|
||||||
// SyncLoop runs periodic work.
|
// SyncLoop runs periodic work.
|
||||||
// This is expected to run as a goroutine or as the main loop of the app.
|
// This is expected to run as a goroutine or as the main loop of the app.
|
||||||
|
@ -138,8 +138,8 @@ type Proxier struct {
|
|||||||
stopChan chan struct{}
|
stopChan chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// assert Proxier is a ProxyProvider
|
// assert Proxier is a proxy.Provider
|
||||||
var _ proxy.ProxyProvider = &Proxier{}
|
var _ proxy.Provider = &Proxier{}
|
||||||
|
|
||||||
// A key for the portMap. The ip has to be a string because slices can't be map
|
// A key for the portMap. The ip has to be a string because slices can't be map
|
||||||
// keys.
|
// keys.
|
||||||
|
@ -510,8 +510,8 @@ type closeable interface {
|
|||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Proxier implements ProxyProvider
|
// Proxier implements proxy.Provider
|
||||||
var _ proxy.ProxyProvider = &Proxier{}
|
var _ proxy.Provider = &Proxier{}
|
||||||
|
|
||||||
// NewProxier returns a new Proxier
|
// NewProxier returns a new Proxier
|
||||||
func NewProxier(
|
func NewProxier(
|
||||||
|
@ -92,8 +92,8 @@ type Proxier struct {
|
|||||||
hostIP net.IP
|
hostIP net.IP
|
||||||
}
|
}
|
||||||
|
|
||||||
// assert Proxier is a ProxyProvider
|
// assert Proxier is a proxy.Provider
|
||||||
var _ proxy.ProxyProvider = &Proxier{}
|
var _ proxy.Provider = &Proxier{}
|
||||||
|
|
||||||
// A key for the portMap. The ip has to be a string because slices can't be map
|
// A key for the portMap. The ip has to be a string because slices can't be map
|
||||||
// keys.
|
// keys.
|
||||||
|
Loading…
Reference in New Issue
Block a user