Merge pull request #79846 from aramase/fix-golint-pkg/proxy

Fix golint failures in pkg/proxy
This commit is contained in:
Kubernetes Prow Robot 2019-08-23 00:51:17 -07:00 committed by GitHub
commit 9c736445f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 18 additions and 19 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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)

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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(

View File

@ -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.