mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
use klog.Info and klog.Warning when had no format
This commit is contained in:
parent
84d15ca322
commit
90f4aeeea4
@ -329,7 +329,7 @@ func makeLeaderElectionConfig(config componentbaseconfig.LeaderElectionConfigura
|
|||||||
// TODO remove masterOverride when CLI flags are removed.
|
// 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) {
|
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 {
|
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
|
// This creates a client, first loading any specified kubeconfig
|
||||||
|
@ -312,7 +312,7 @@ func (rc *reconciler) reportMultiAttachError(volumeToAttach cache.VolumeToAttach
|
|||||||
// Log detailed message to system admin
|
// Log detailed message to system admin
|
||||||
nodeList := strings.Join(otherNodesStr, ", ")
|
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))
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,7 +544,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
klet.configMapManager = configMapManager
|
klet.configMapManager = configMapManager
|
||||||
|
|
||||||
if klet.experimentalHostUserNamespaceDefaulting {
|
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()
|
machineInfo, err := klet.cadvisor.MachineInfo()
|
||||||
|
@ -204,9 +204,9 @@ func sortGroupDiscoveryByKubeAwareVersion(gd []metav1.GroupVersionForDiscovery)
|
|||||||
func (c *DiscoveryController) Run(stopCh <-chan struct{}, synchedCh chan<- struct{}) {
|
func (c *DiscoveryController) Run(stopCh <-chan struct{}, synchedCh chan<- struct{}) {
|
||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
defer c.queue.ShutDown()
|
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) {
|
if !cache.WaitForCacheSync(stopCh, c.crdsSynced) {
|
||||||
utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
|
utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
|
||||||
|
@ -73,8 +73,8 @@ func (ec *EstablishingController) Run(stopCh <-chan struct{}) {
|
|||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
defer ec.queue.ShutDown()
|
defer ec.queue.ShutDown()
|
||||||
|
|
||||||
klog.Infof("Starting EstablishingController")
|
klog.Info("Starting EstablishingController")
|
||||||
defer klog.Infof("Shutting down EstablishingController")
|
defer klog.Info("Shutting down EstablishingController")
|
||||||
|
|
||||||
if !cache.WaitForCacheSync(stopCh, ec.crdSynced) {
|
if !cache.WaitForCacheSync(stopCh, ec.crdSynced) {
|
||||||
return
|
return
|
||||||
|
@ -263,8 +263,8 @@ func (c *CRDFinalizer) Run(workers int, stopCh <-chan struct{}) {
|
|||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
defer c.queue.ShutDown()
|
defer c.queue.ShutDown()
|
||||||
|
|
||||||
klog.Infof("Starting CRDFinalizer")
|
klog.Info("Starting CRDFinalizer")
|
||||||
defer klog.Infof("Shutting down CRDFinalizer")
|
defer klog.Info("Shutting down CRDFinalizer")
|
||||||
|
|
||||||
if !cache.WaitForCacheSync(stopCh, c.crdSynced) {
|
if !cache.WaitForCacheSync(stopCh, c.crdSynced) {
|
||||||
return
|
return
|
||||||
|
@ -288,8 +288,8 @@ func (c *NamingConditionController) Run(stopCh <-chan struct{}) {
|
|||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
defer c.queue.ShutDown()
|
defer c.queue.ShutDown()
|
||||||
|
|
||||||
klog.Infof("Starting NamingConditionController")
|
klog.Info("Starting NamingConditionController")
|
||||||
defer klog.Infof("Shutting down NamingConditionController")
|
defer klog.Info("Shutting down NamingConditionController")
|
||||||
|
|
||||||
if !cache.WaitForCacheSync(stopCh, c.crdSynced) {
|
if !cache.WaitForCacheSync(stopCh, c.crdSynced) {
|
||||||
return
|
return
|
||||||
|
@ -130,7 +130,7 @@ func SetTransportDefaults(t *http.Transport) *http.Transport {
|
|||||||
t = SetOldTransportDefaults(t)
|
t = SetOldTransportDefaults(t)
|
||||||
// Allow clients to disable http2 if needed.
|
// Allow clients to disable http2 if needed.
|
||||||
if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 {
|
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) {
|
} else if allowsHTTP2(t) {
|
||||||
if err := http2.ConfigureTransport(t); err != nil {
|
if err := http2.ConfigureTransport(t); err != nil {
|
||||||
klog.Warningf("Transport failed http2 configuration: %v", err)
|
klog.Warningf("Transport failed http2 configuration: %v", err)
|
||||||
|
@ -69,7 +69,7 @@ func dialURL(ctx context.Context, url *url.URL, transport http.RoundTripper) (ne
|
|||||||
}
|
}
|
||||||
if tlsConfig == nil {
|
if tlsConfig == nil {
|
||||||
// tls.Client requires non-nil config
|
// 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
|
// tls.Handshake() requires ServerName or InsecureSkipVerify
|
||||||
tlsConfig = &tls.Config{
|
tlsConfig = &tls.Config{
|
||||||
InsecureSkipVerify: true,
|
InsecureSkipVerify: true,
|
||||||
|
@ -37,7 +37,7 @@ import (
|
|||||||
// is invoked to serve the request.
|
// is invoked to serve the request.
|
||||||
func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences) http.Handler {
|
func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences) http.Handler {
|
||||||
if auth == nil {
|
if auth == nil {
|
||||||
klog.Warningf("Authentication is disabled")
|
klog.Warning("Authentication is disabled")
|
||||||
return handler
|
return handler
|
||||||
}
|
}
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -44,7 +44,7 @@ const (
|
|||||||
// WithAuthorizationCheck passes all authorized requests on to handler, and returns a forbidden error otherwise.
|
// 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 {
|
func WithAuthorization(handler http.Handler, a authorizer.Authorizer, s runtime.NegotiatedSerializer) http.Handler {
|
||||||
if a == nil {
|
if a == nil {
|
||||||
klog.Warningf("Authorization is disabled")
|
klog.Warning("Authorization is disabled")
|
||||||
return handler
|
return handler
|
||||||
}
|
}
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -330,8 +330,8 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(authenticationInfo *server.Aut
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
if s.TolerateInClusterLookupFailure {
|
if s.TolerateInClusterLookupFailure {
|
||||||
klog.Warningf("Error looking up in-cluster authentication configuration: %v", err)
|
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.Warning("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("To require authentication configuration lookup to succeed, set --authentication-tolerate-lookup-failure=false")
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("unable to load configmap based request-header-client-ca-file: %v", err)
|
return fmt.Errorf("unable to load configmap based request-header-client-ca-file: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ func (s *DelegatingAuthorizationOptions) toAuthorizer(client kubernetes.Interfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
if client == nil {
|
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 {
|
} else {
|
||||||
cfg := authorizerfactory.DelegatingAuthorizerConfig{
|
cfg := authorizerfactory.DelegatingAuthorizerConfig{
|
||||||
SubjectAccessReviewClient: client.AuthorizationV1().SubjectAccessReviews(),
|
SubjectAccessReviewClient: client.AuthorizationV1().SubjectAccessReviews(),
|
||||||
|
@ -611,7 +611,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
|
||||||
|
@ -425,7 +425,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)
|
||||||
@ -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))
|
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)
|
||||||
|
@ -133,7 +133,7 @@ type conversionFuncMap map[conversionPair]*types.Type
|
|||||||
// Returns all manually-defined conversion functions in the package.
|
// Returns all manually-defined conversion functions in the package.
|
||||||
func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) {
|
func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) {
|
||||||
if pkg == nil {
|
if pkg == nil {
|
||||||
klog.Warningf("Skipping nil package passed to getManualConversionFunctions")
|
klog.Warning("Skipping nil package passed to getManualConversionFunctions")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name)
|
klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name)
|
||||||
@ -641,7 +641,7 @@ func (g *genConversion) Init(c *generator.Context, w io.Writer) error {
|
|||||||
if klog.V(5).Enabled() {
|
if klog.V(5).Enabled() {
|
||||||
if m, ok := g.useUnsafe.(equalMemoryTypes); ok {
|
if m, ok := g.useUnsafe.(equalMemoryTypes); ok {
|
||||||
var result []string
|
var result []string
|
||||||
klog.Infof("All objects without identical memory layout:")
|
klog.Info("All objects without identical memory layout:")
|
||||||
for k, v := range m {
|
for k, v := range m {
|
||||||
if v {
|
if v {
|
||||||
continue
|
continue
|
||||||
|
@ -94,8 +94,8 @@ func (c *APIServiceRegistrationController) Run(stopCh <-chan struct{}, handlerSy
|
|||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
defer c.queue.ShutDown()
|
defer c.queue.ShutDown()
|
||||||
|
|
||||||
klog.Infof("Starting APIServiceRegistrationController")
|
klog.Info("Starting APIServiceRegistrationController")
|
||||||
defer klog.Infof("Shutting down APIServiceRegistrationController")
|
defer klog.Info("Shutting down APIServiceRegistrationController")
|
||||||
|
|
||||||
if !controllers.WaitForCacheSync("APIServiceRegistrationController", stopCh, c.apiServiceSynced) {
|
if !controllers.WaitForCacheSync("APIServiceRegistrationController", stopCh, c.apiServiceSynced) {
|
||||||
return
|
return
|
||||||
|
@ -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
|
// make sure the work queue is shutdown which will trigger workers to end
|
||||||
defer c.queue.ShutDown()
|
defer c.queue.ShutDown()
|
||||||
|
|
||||||
klog.Infof("Starting autoregister controller")
|
klog.Info("Starting autoregister controller")
|
||||||
defer klog.Infof("Shutting down autoregister controller")
|
defer klog.Info("Shutting down autoregister controller")
|
||||||
|
|
||||||
// wait for your secondary caches to fill before starting your work
|
// wait for your secondary caches to fill before starting your work
|
||||||
if !controllers.WaitForCacheSync("autoregister", stopCh, c.apiServiceSynced) {
|
if !controllers.WaitForCacheSync("autoregister", stopCh, c.apiServiceSynced) {
|
||||||
|
@ -80,8 +80,8 @@ func (c *AggregationController) Run(stopCh <-chan struct{}) {
|
|||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
defer c.queue.ShutDown()
|
defer c.queue.ShutDown()
|
||||||
|
|
||||||
klog.Infof("Starting OpenAPI AggregationController")
|
klog.Info("Starting OpenAPI AggregationController")
|
||||||
defer klog.Infof("Shutting down OpenAPI AggregationController")
|
defer klog.Info("Shutting down OpenAPI AggregationController")
|
||||||
|
|
||||||
go wait.Until(c.runWorker, time.Second, stopCh)
|
go wait.Until(c.runWorker, time.Second, stopCh)
|
||||||
|
|
||||||
|
@ -454,8 +454,8 @@ func (c *AvailableConditionController) Run(threadiness int, stopCh <-chan struct
|
|||||||
defer utilruntime.HandleCrash()
|
defer utilruntime.HandleCrash()
|
||||||
defer c.queue.ShutDown()
|
defer c.queue.ShutDown()
|
||||||
|
|
||||||
klog.Infof("Starting AvailableConditionController")
|
klog.Info("Starting AvailableConditionController")
|
||||||
defer klog.Infof("Shutting down AvailableConditionController")
|
defer klog.Info("Shutting down AvailableConditionController")
|
||||||
|
|
||||||
if !controllers.WaitForCacheSync("AvailableConditionController", stopCh, c.apiServiceSynced, c.servicesSynced, c.endpointsSynced) {
|
if !controllers.WaitForCacheSync("AvailableConditionController", stopCh, c.apiServiceSynced, c.servicesSynced, c.endpointsSynced) {
|
||||||
return
|
return
|
||||||
|
@ -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
|
// GetAllCurrentZones returns all the zones in which k8s nodes are currently running
|
||||||
func (g *Cloud) GetAllCurrentZones() (sets.String, error) {
|
func (g *Cloud) GetAllCurrentZones() (sets.String, error) {
|
||||||
if g.nodeInformerSynced == nil {
|
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()
|
return g.GetAllZonesFromCloudProvider()
|
||||||
}
|
}
|
||||||
g.nodeZonesLock.Lock()
|
g.nodeZonesLock.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user