use klog.Info and klog.Warning when had no format

Kubernetes-commit: 90f4aeeea4cc5f96caa6ed87c67ca7e62d1ba21c
This commit is contained in:
xiongzhongliang 2020-11-14 00:55:06 +08:00 committed by Kubernetes Publisher
parent 537eda74d8
commit d7ba1f2e01
2 changed files with 3 additions and 3 deletions

View File

@ -612,7 +612,7 @@ func (config *inClusterClientConfig) Possible() bool {
// to the default config. // to the default config.
func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) { func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) {
if kubeconfigPath == "" && masterUrl == "" { if kubeconfigPath == "" && masterUrl == "" {
klog.Warningf("Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.") klog.Warning("Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.")
kubeconfig, err := restclient.InClusterConfig() kubeconfig, err := restclient.InClusterConfig()
if err == nil { if err == nil {
return kubeconfig, nil return kubeconfig, nil

View File

@ -426,7 +426,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
} }
if rt.levels[debugRequestHeaders] { if rt.levels[debugRequestHeaders] {
klog.Infof("Request Headers:") klog.Info("Request Headers:")
for key, values := range reqInfo.RequestHeaders { for key, values := range reqInfo.RequestHeaders {
for _, value := range values { for _, value := range values {
value = maskValue(key, value) value = maskValue(key, value)
@ -448,7 +448,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e
klog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) klog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond))
} }
if rt.levels[debugResponseHeaders] { if rt.levels[debugResponseHeaders] {
klog.Infof("Response Headers:") klog.Info("Response Headers:")
for key, values := range reqInfo.ResponseHeaders { for key, values := range reqInfo.ResponseHeaders {
for _, value := range values { for _, value := range values {
klog.Infof(" %s: %s", key, value) klog.Infof(" %s: %s", key, value)