Merge pull request #86665 from SataQiu/clean-proxy-20191227

kube-proxy: add some interface type assertions
This commit is contained in:
Kubernetes Prow Robot 2020-01-02 22:25:40 -08:00 committed by GitHub
commit 30090d0809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -97,6 +97,8 @@ func (*NoopEndpointSliceHandler) OnEndpointSliceDelete(endpointSlice *discovery.
// OnEndpointSlicesSynced is a noop handler for EndpointSlice syncs.
func (*NoopEndpointSliceHandler) OnEndpointSlicesSynced() {}
var _ EndpointSliceHandler = &NoopEndpointSliceHandler{}
// EndpointsConfig tracks a set of endpoints configurations.
type EndpointsConfig struct {
listerSynced cache.InformerSynced
@ -403,6 +405,8 @@ func (*NoopNodeHandler) OnNodeDelete(node *v1.Node) {}
// OnNodeSynced is a noop handler for Node syncs.
func (*NoopNodeHandler) OnNodeSynced() {}
var _ NodeHandler = &NoopNodeHandler{}
// NodeConfig tracks a set of node configurations.
// It accepts "set", "add" and "remove" operations of node via channels, and invokes registered handlers on change.
type NodeConfig struct {

View File

@ -44,6 +44,8 @@ type ProxierHealthUpdater interface {
Updated()
}
var _ ProxierHealthUpdater = &ProxierHealthServer{}
// ProxierHealthServer returns 200 "OK" by default. It verifies that the delay between
// QueuedUpdate() calls and Updated() calls never exceeds healthTimeout.
type ProxierHealthServer struct {

View File

@ -91,6 +91,8 @@ func CanUseIPTablesProxier(kcompat KernelCompatTester) (bool, error) {
return true, nil
}
var _ KernelCompatTester = LinuxKernelCompatTester{}
// LinuxKernelCompatTester is the Linux implementation of KernelCompatTester
type LinuxKernelCompatTester struct{}