Migrated server.go, ipvs/proxier.go(partial) to structured logging (#105769)

* fixed improperly migrated logs

* fixed improperly migrated logs

* fixed improperly migrated logs

* fixed improperly migrated logs

* Update cmd/kube-proxy/app/server.go

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

* Update pkg/proxy/ipvs/proxier.go

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

* Update pkg/proxy/ipvs/proxier.go

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

* Update pkg/proxy/ipvs/proxier.go

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

* Update pkg/proxy/ipvs/proxier.go

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>
This commit is contained in:
Shivanshu Raj Shrivastava
2021-10-20 15:24:11 +05:30
committed by GitHub
parent e461ebeea0
commit d3f81a1be6
2 changed files with 38 additions and 38 deletions

View File

@@ -222,7 +222,7 @@ func NewOptions() *Options {
// Complete completes all the required options.
func (o *Options) Complete() error {
if len(o.ConfigFile) == 0 && len(o.WriteConfigTo) == 0 {
klog.InfoS("WARNING: all flags other than --config, --write-config-to, and --cleanup are deprecated. Please begin using a config file ASAP")
klog.InfoS("Warning, all flags other than --config, --write-config-to, and --cleanup are deprecated, please begin using a config file ASAP")
o.config.HealthzBindAddress = addressFromDeprecatedFlags(o.config.HealthzBindAddress, o.healthzPort)
o.config.MetricsBindAddress = addressFromDeprecatedFlags(o.config.MetricsBindAddress, o.metricsPort)
}
@@ -498,7 +498,8 @@ with the apiserver API to configure the proxy.`,
}
if err := opts.Run(); err != nil {
klog.Exit(err)
klog.ErrorS(err, "Error running ProxyServer")
os.Exit(1)
}
},
Args: func(cmd *cobra.Command, args []string) error {
@@ -560,7 +561,7 @@ func createClients(config componentbaseconfig.ClientConnectionConfiguration, mas
var err error
if len(config.Kubeconfig) == 0 && len(masterOverride) == 0 {
klog.InfoS("Neither kubeconfig file nor master URL was specified. Falling back to in-cluster config")
klog.InfoS("Neither kubeconfig file nor master URL was specified, falling back to in-cluster config")
kubeConfig, err = rest.InClusterConfig()
} else {
// This creates a client, first loading any specified kubeconfig
@@ -843,7 +844,7 @@ func detectNodeIP(client clientset.Interface, hostname, bindAddress string) net.
nodeIP = utilnode.GetNodeIP(client, hostname)
}
if nodeIP == nil {
klog.V(0).Infof("can't determine this node's IP, assuming 127.0.0.1; if this is incorrect, please set the --bind-address flag")
klog.V(0).InfoS("Can't determine this node's IP, assuming 127.0.0.1; if this is incorrect, please set the --bind-address flag")
nodeIP = netutils.ParseIPSloppy("127.0.0.1")
}
return nodeIP