mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
fix golint failures of cmd/kube-proxy/app
This commit is contained in:
parent
ed2bdd53dc
commit
cc199c74fc
@ -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 {
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
// Enable pprof HTTP handlers.
|
||||
_ "net/http/pprof"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user