Skip to content

Commit 30090d0

Browse files
authored
Merge pull request kubernetes#86665 from SataQiu/clean-proxy-20191227
kube-proxy: add some interface type assertions
2 parents 1780792 + 134c545 commit 30090d0

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

pkg/proxy/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ func (*NoopEndpointSliceHandler) OnEndpointSliceDelete(endpointSlice *discovery.
9797
// OnEndpointSlicesSynced is a noop handler for EndpointSlice syncs.
9898
func (*NoopEndpointSliceHandler) OnEndpointSlicesSynced() {}
9999

100+
var _ EndpointSliceHandler = &NoopEndpointSliceHandler{}
101+
100102
// EndpointsConfig tracks a set of endpoints configurations.
101103
type EndpointsConfig struct {
102104
listerSynced cache.InformerSynced
@@ -403,6 +405,8 @@ func (*NoopNodeHandler) OnNodeDelete(node *v1.Node) {}
403405
// OnNodeSynced is a noop handler for Node syncs.
404406
func (*NoopNodeHandler) OnNodeSynced() {}
405407

408+
var _ NodeHandler = &NoopNodeHandler{}
409+
406410
// NodeConfig tracks a set of node configurations.
407411
// It accepts "set", "add" and "remove" operations of node via channels, and invokes registered handlers on change.
408412
type NodeConfig struct {

pkg/proxy/healthcheck/proxier_health.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ type ProxierHealthUpdater interface {
4444
Updated()
4545
}
4646

47+
var _ ProxierHealthUpdater = &ProxierHealthServer{}
48+
4749
// ProxierHealthServer returns 200 "OK" by default. It verifies that the delay between
4850
// QueuedUpdate() calls and Updated() calls never exceeds healthTimeout.
4951
type ProxierHealthServer struct {

pkg/proxy/iptables/proxier.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ func CanUseIPTablesProxier(kcompat KernelCompatTester) (bool, error) {
9191
return true, nil
9292
}
9393

94+
var _ KernelCompatTester = LinuxKernelCompatTester{}
95+
9496
// LinuxKernelCompatTester is the Linux implementation of KernelCompatTester
9597
type LinuxKernelCompatTester struct{}
9698

0 commit comments

Comments
 (0)