From 9dce640213b59e0547496465a6d2747e4094f3dc Mon Sep 17 00:00:00 2001 From: m1093782566 Date: Tue, 24 Oct 2017 10:30:38 +0800 Subject: [PATCH] fix review comments --- cmd/kube-proxy/app/server_others.go | 4 ++-- pkg/proxy/ipvs/proxier.go | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/kube-proxy/app/server_others.go b/cmd/kube-proxy/app/server_others.go index a40d45ed67..bbd13c247c 100644 --- a/cmd/kube-proxy/app/server_others.go +++ b/cmd/kube-proxy/app/server_others.go @@ -144,6 +144,7 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx if err != nil { return nil, fmt.Errorf("unable to create proxier: %v", err) } + metrics.RegisterMetrics() proxier = proxierIPTables serviceEventHandler = proxierIPTables endpointsEventHandler = proxierIPTables @@ -175,6 +176,7 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx if err != nil { return nil, fmt.Errorf("unable to create proxier: %v", err) } + metrics.RegisterMetrics() proxier = proxierIPVS serviceEventHandler = proxierIPVS endpointsEventHandler = proxierIPVS @@ -218,8 +220,6 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx iptInterface.AddReloadFunc(proxier.Sync) - metrics.RegisterMetrics() - return &ProxyServer{ Client: client, EventClient: eventClient, diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index 1d3da2f1f7..8510f7363e 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -855,12 +855,6 @@ func (proxier *Proxier) OnEndpointsSynced() { proxier.syncProxyRules() } -type syncReason string - -const syncReasonServices syncReason = "ServicesUpdate" -const syncReasonEndpoints syncReason = "EndpointsUpdate" -const syncReasonForce syncReason = "Force" - // This is where all of the ipvs calls happen. // assumes proxier.mu is held func (proxier *Proxier) syncProxyRules() {