Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/kube-scheduler/app/options/options.go
Expand Up @@ -329,7 +329,7 @@ func makeLeaderElectionConfig(config componentbaseconfig.LeaderElectionConfigura
// TODO remove masterOverride when CLI flags are removed.
func createClients(config componentbaseconfig.ClientConnectionConfiguration, masterOverride string, timeout time.Duration) (clientset.Interface, clientset.Interface, clientset.Interface, error) {
if len(config.Kubeconfig) == 0 && len(masterOverride) == 0 {
klog.Warningf("Neither --kubeconfig nor --master was specified. Using default API client. This might not work.")
klog.Warning("Neither --kubeconfig nor --master was specified. Using default API client. This might not work.")
}

// This creates a client, first loading any specified kubeconfig
Expand Down
Expand Up @@ -312,7 +312,7 @@ func (rc *reconciler) reportMultiAttachError(volumeToAttach cache.VolumeToAttach
// Log detailed message to system admin
nodeList := strings.Join(otherNodesStr, ", ")
detailedMsg := volumeToAttach.GenerateMsgDetailed("Multi-Attach error", fmt.Sprintf("Volume is already exclusively attached to node %s and can't be attached to another", nodeList))
klog.Warningf(detailedMsg)
klog.Warning(detailedMsg)
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/kubelet.go
Expand Up @@ -544,7 +544,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
klet.configMapManager = configMapManager

if klet.experimentalHostUserNamespaceDefaulting {
klog.Infof("Experimental host user namespace defaulting is enabled.")
klog.Info("Experimental host user namespace defaulting is enabled.")
}

machineInfo, err := klet.cadvisor.MachineInfo()
Expand Down
Expand Up @@ -204,9 +204,9 @@ func sortGroupDiscoveryByKubeAwareVersion(gd []metav1.GroupVersionForDiscovery)
func (c *DiscoveryController) Run(stopCh <-chan struct{}, synchedCh chan<- struct{}) {
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()
defer klog.Infof("Shutting down DiscoveryController")
defer klog.Info("Shutting down DiscoveryController")

klog.Infof("Starting DiscoveryController")
klog.Info("Starting DiscoveryController")

if !cache.WaitForCacheSync(stopCh, c.crdsSynced) {
utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
Expand Down
Expand Up @@ -73,8 +73,8 @@ func (ec *EstablishingController) Run(stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer ec.queue.ShutDown()

klog.Infof("Starting EstablishingController")
defer klog.Infof("Shutting down EstablishingController")
klog.Info("Starting EstablishingController")
defer klog.Info("Shutting down EstablishingController")

if !cache.WaitForCacheSync(stopCh, ec.crdSynced) {
return
Expand Down
Expand Up @@ -263,8 +263,8 @@ func (c *CRDFinalizer) Run(workers int, stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()

klog.Infof("Starting CRDFinalizer")
defer klog.Infof("Shutting down CRDFinalizer")
klog.Info("Starting CRDFinalizer")
defer klog.Info("Shutting down CRDFinalizer")

if !cache.WaitForCacheSync(stopCh, c.crdSynced) {
return
Expand Down
Expand Up @@ -288,8 +288,8 @@ func (c *NamingConditionController) Run(stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()

klog.Infof("Starting NamingConditionController")
defer klog.Infof("Shutting down NamingConditionController")
klog.Info("Starting NamingConditionController")
defer klog.Info("Shutting down NamingConditionController")

if !cache.WaitForCacheSync(stopCh, c.crdSynced) {
return
Expand Down
2 changes: 1 addition & 1 deletion staging/src/k8s.io/apimachinery/pkg/util/net/http.go
Expand Up @@ -130,7 +130,7 @@ func SetTransportDefaults(t *http.Transport) *http.Transport {
t = SetOldTransportDefaults(t)
// Allow clients to disable http2 if needed.
if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 {
klog.Infof("HTTP2 has been explicitly disabled")
klog.Info("HTTP2 has been explicitly disabled")
} else if allowsHTTP2(t) {
if err := http2.ConfigureTransport(t); err != nil {
klog.Warningf("Transport failed http2 configuration: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion staging/src/k8s.io/apimachinery/pkg/util/proxy/dial.go
Expand Up @@ -69,7 +69,7 @@ func dialURL(ctx context.Context, url *url.URL, transport http.RoundTripper) (ne
}
if tlsConfig == nil {
// tls.Client requires non-nil config
klog.Warningf("using custom dialer with no TLSClientConfig. Defaulting to InsecureSkipVerify")
klog.Warning("using custom dialer with no TLSClientConfig. Defaulting to InsecureSkipVerify")
// tls.Handshake() requires ServerName or InsecureSkipVerify
tlsConfig = &tls.Config{
InsecureSkipVerify: true,
Expand Down
Expand Up @@ -37,7 +37,7 @@ import (
// is invoked to serve the request.
func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences) http.Handler {
if auth == nil {
klog.Warningf("Authentication is disabled")
klog.Warning("Authentication is disabled")
return handler
}
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
Expand Down
Expand Up @@ -44,7 +44,7 @@ const (
// WithAuthorizationCheck passes all authorized requests on to handler, and returns a forbidden error otherwise.
func WithAuthorization(handler http.Handler, a authorizer.Authorizer, s runtime.NegotiatedSerializer) http.Handler {
if a == nil {
klog.Warningf("Authorization is disabled")
klog.Warning("Authorization is disabled")
return handler
}
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
Expand Down
Expand Up @@ -330,8 +330,8 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(authenticationInfo *server.Aut
if err != nil {
if s.TolerateInClusterLookupFailure {
klog.Warningf("Error looking up in-cluster authentication configuration: %v", err)
klog.Warningf("Continuing without authentication configuration. This may treat all requests as anonymous.")
klog.Warningf("To require authentication configuration lookup to succeed, set --authentication-tolerate-lookup-failure=false")
klog.Warning("Continuing without authentication configuration. This may treat all requests as anonymous.")
klog.Warning("To require authentication configuration lookup to succeed, set --authentication-tolerate-lookup-failure=false")
} else {
return fmt.Errorf("unable to load configmap based request-header-client-ca-file: %v", err)
}
Expand Down
Expand Up @@ -170,7 +170,7 @@ func (s *DelegatingAuthorizationOptions) toAuthorizer(client kubernetes.Interfac
}

if client == nil {
klog.Warningf("No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.")
klog.Warning("No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.")
} else {
cfg := authorizerfactory.DelegatingAuthorizerConfig{
SubjectAccessReviewClient: client.AuthorizationV1().SubjectAccessReviews(),
Expand Down
Expand Up @@ -611,7 +611,7 @@ func (config *inClusterClientConfig) Possible() bool {
// to the default config.
func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) {
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()
if err == nil {
return kubeconfig, nil
Expand Down
4 changes: 2 additions & 2 deletions staging/src/k8s.io/client-go/transport/round_trippers.go
Expand Up @@ -425,7 +425,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e

}
if rt.levels[debugRequestHeaders] {
klog.Infof("Request Headers:")
klog.Info("Request Headers:")
for key, values := range reqInfo.RequestHeaders {
for _, value := range values {
value = maskValue(key, value)
Expand All @@ -447,7 +447,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))
}
if rt.levels[debugResponseHeaders] {
klog.Infof("Response Headers:")
klog.Info("Response Headers:")
for key, values := range reqInfo.ResponseHeaders {
for _, value := range values {
klog.Infof(" %s: %s", key, value)
Expand Down
Expand Up @@ -133,7 +133,7 @@ type conversionFuncMap map[conversionPair]*types.Type
// Returns all manually-defined conversion functions in the package.
func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) {
if pkg == nil {
klog.Warningf("Skipping nil package passed to getManualConversionFunctions")
klog.Warning("Skipping nil package passed to getManualConversionFunctions")
return
}
klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name)
Expand Down Expand Up @@ -641,7 +641,7 @@ func (g *genConversion) Init(c *generator.Context, w io.Writer) error {
if klog.V(5).Enabled() {
if m, ok := g.useUnsafe.(equalMemoryTypes); ok {
var result []string
klog.Infof("All objects without identical memory layout:")
klog.Info("All objects without identical memory layout:")
for k, v := range m {
if v {
continue
Expand Down
Expand Up @@ -94,8 +94,8 @@ func (c *APIServiceRegistrationController) Run(stopCh <-chan struct{}, handlerSy
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()

klog.Infof("Starting APIServiceRegistrationController")
defer klog.Infof("Shutting down APIServiceRegistrationController")
klog.Info("Starting APIServiceRegistrationController")
defer klog.Info("Shutting down APIServiceRegistrationController")

if !controllers.WaitForCacheSync("APIServiceRegistrationController", stopCh, c.apiServiceSynced) {
return
Expand Down
Expand Up @@ -138,8 +138,8 @@ func (c *autoRegisterController) Run(threadiness int, stopCh <-chan struct{}) {
// make sure the work queue is shutdown which will trigger workers to end
defer c.queue.ShutDown()

klog.Infof("Starting autoregister controller")
defer klog.Infof("Shutting down autoregister controller")
klog.Info("Starting autoregister controller")
defer klog.Info("Shutting down autoregister controller")

// wait for your secondary caches to fill before starting your work
if !controllers.WaitForCacheSync("autoregister", stopCh, c.apiServiceSynced) {
Expand Down
Expand Up @@ -80,8 +80,8 @@ func (c *AggregationController) Run(stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()

klog.Infof("Starting OpenAPI AggregationController")
defer klog.Infof("Shutting down OpenAPI AggregationController")
klog.Info("Starting OpenAPI AggregationController")
defer klog.Info("Shutting down OpenAPI AggregationController")

go wait.Until(c.runWorker, time.Second, stopCh)

Expand Down
Expand Up @@ -454,8 +454,8 @@ func (c *AvailableConditionController) Run(threadiness int, stopCh <-chan struct
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()

klog.Infof("Starting AvailableConditionController")
defer klog.Infof("Shutting down AvailableConditionController")
klog.Info("Starting AvailableConditionController")
defer klog.Info("Shutting down AvailableConditionController")

if !controllers.WaitForCacheSync("AvailableConditionController", stopCh, c.apiServiceSynced, c.servicesSynced, c.endpointsSynced) {
return
Expand Down
Expand Up @@ -407,7 +407,7 @@ func (g *Cloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyDat
// GetAllCurrentZones returns all the zones in which k8s nodes are currently running
func (g *Cloud) GetAllCurrentZones() (sets.String, error) {
if g.nodeInformerSynced == nil {
klog.Warningf("Cloud object does not have informers set, should only happen in E2E binary.")
klog.Warning("Cloud object does not have informers set, should only happen in E2E binary.")
return g.GetAllZonesFromCloudProvider()
}
g.nodeZonesLock.Lock()
Expand Down