Merge pull request #76497 from SataQiu/fix-golint-20190413

Fix golint failures of cmd/kube-proxy/app
This commit is contained in:
Kubernetes Prow Robot 2019-04-15 10:26:53 -07:00 committed by GitHub
commit 631bf8cbc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -196,6 +196,7 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
"Options are:\n"+strings.Join(utilfeature.DefaultFeatureGate.KnownFeatures(), "\n"))
}
// NewOptions returns initialized Options
func NewOptions() *Options {
return &Options{
config: new(kubeproxyconfig.KubeProxyConfiguration),
@ -218,11 +219,11 @@ func (o *Options) Complete() error {
// Load the config file here in Complete, so that Validate validates the fully-resolved config.
if len(o.ConfigFile) > 0 {
if c, err := o.loadConfigFromFile(o.ConfigFile); err != nil {
c, err := o.loadConfigFromFile(o.ConfigFile)
if err != nil {
return err
} else {
o.config = c
}
o.config = c
if err := o.initWatcher(); err != nil {
return err
@ -295,6 +296,7 @@ func (o *Options) Validate(args []string) error {
return nil
}
// Run runs the specified ProxyServer.
func (o *Options) Run() error {
defer close(o.errCh)
if len(o.WriteConfigTo) > 0 {
@ -415,6 +417,7 @@ func (o *Options) loadConfig(data []byte) (*kubeproxyconfig.KubeProxyConfigurati
return proxyConfig, nil
}
// ApplyDefaults applies the default values to Options.
func (o *Options) ApplyDefaults(in *kubeproxyconfig.KubeProxyConfiguration) (*kubeproxyconfig.KubeProxyConfiguration, error) {
external, err := o.scheme.ConvertToVersion(in, v1alpha1.SchemeGroupVersion)
if err != nil {

View File

@ -24,6 +24,7 @@ import (
"errors"
"fmt"
"net"
// Enable pprof HTTP handlers.
_ "net/http/pprof"
"k8s.io/api/core/v1"

View File

@ -1,7 +1,6 @@
cmd/cloud-controller-manager/app/apis/config/v1alpha1
cmd/kube-apiserver/app
cmd/kube-controller-manager/app
cmd/kube-proxy/app
cmd/kubeadm/app/apis/kubeadm/v1beta1
pkg/apis/abac/latest
pkg/apis/admission