Fix golint failures in pkg/proxy

Review feedback - remove alias from imports

fix comments
This commit is contained in:
Anish Ramasekar
2019-07-05 12:44:37 -07:00
parent 00cf865762
commit 2878270f5b
12 changed files with 18 additions and 19 deletions

View File

@@ -200,7 +200,7 @@ type UpdateEndpointMapResult struct {
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) {
result.StaleEndpoints = make([]ServiceEndpoint, 0)
result.StaleServiceNames = make([]ServicePortName, 0)

View File

@@ -272,8 +272,8 @@ func (l *listenPortOpener) OpenLocalPort(lp *utilproxy.LocalPort) (utilproxy.Clo
return openLocalPort(lp)
}
// Proxier implements ProxyProvider
var _ proxy.ProxyProvider = &Proxier{}
// 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.

View File

@@ -271,8 +271,8 @@ func (r *realIPGetter) NodeIPs() (ips []net.IP, err error) {
return ips, nil
}
// Proxier implements ProxyProvider
var _ proxy.ProxyProvider = &Proxier{}
// Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{}
// 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

View File

@@ -25,12 +25,12 @@ import (
"k8s.io/kubernetes/pkg/proxy/config"
)
// ProxyProvider is the interface provided by proxier implementations.
type ProxyProvider interface {
// Provider is the interface provided by proxier implementations.
type Provider interface {
config.EndpointsHandler
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()
// SyncLoop runs periodic work.
// 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{}
}
// assert Proxier is a ProxyProvider
var _ proxy.ProxyProvider = &Proxier{}
// assert Proxier is a proxy.Provider
var _ proxy.Provider = &Proxier{}
// A key for the portMap. The ip has to be a string because slices can't be map
// keys.

View File

@@ -510,8 +510,8 @@ type closeable interface {
Close() error
}
// Proxier implements ProxyProvider
var _ proxy.ProxyProvider = &Proxier{}
// Proxier implements proxy.Provider
var _ proxy.Provider = &Proxier{}
// NewProxier returns a new Proxier
func NewProxier(

View File

@@ -92,8 +92,8 @@ type Proxier struct {
hostIP net.IP
}
// assert Proxier is a ProxyProvider
var _ proxy.ProxyProvider = &Proxier{}
// assert Proxier is a proxy.Provider
var _ proxy.Provider = &Proxier{}
// A key for the portMap. The ip has to be a string because slices can't be map
// keys.