mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Structured Logging migration: for package staging/src/k8s.io/apiserver/pkg/server/dynamiccertificates
Signed-off-by: sanwishe <jiang.mingzhi35@zte.com.cn>
This commit is contained in:
parent
c08526c7f7
commit
6eb645088c
@ -198,8 +198,8 @@ func (c *ConfigMapCAController) Run(workers int, stopCh <-chan struct{}) {
|
||||
defer utilruntime.HandleCrash()
|
||||
defer c.queue.ShutDown()
|
||||
|
||||
klog.Infof("Starting %s", c.name)
|
||||
defer klog.Infof("Shutting down %s", c.name)
|
||||
klog.InfoS("Starting controller", "name", c.name)
|
||||
defer klog.InfoS("Shutting down controller", "name", c.name)
|
||||
|
||||
// we have a personal informer that is narrowly scoped, start it.
|
||||
go c.configMapInformer.Run(stopCh)
|
||||
|
@ -114,7 +114,7 @@ func (c *DynamicFileCAContent) loadCABundle() error {
|
||||
return err
|
||||
}
|
||||
c.caBundle.Store(caBundleAndVerifier)
|
||||
klog.V(2).Infof("Loaded a new CA Bundle and Verifier for %q", c.Name())
|
||||
klog.V(2).InfoS("Loaded a new CA Bundle and Verifier", "name", c.Name())
|
||||
|
||||
for _, listener := range c.listeners {
|
||||
listener.Enqueue()
|
||||
@ -152,8 +152,8 @@ func (c *DynamicFileCAContent) Run(workers int, stopCh <-chan struct{}) {
|
||||
defer utilruntime.HandleCrash()
|
||||
defer c.queue.ShutDown()
|
||||
|
||||
klog.Infof("Starting %s", c.name)
|
||||
defer klog.Infof("Shutting down %s", c.name)
|
||||
klog.InfoS("Starting controller", "name", c.name)
|
||||
defer klog.InfoS("Shutting down controller", "name", c.name)
|
||||
|
||||
// doesn't matter what workers say, only start one.
|
||||
go wait.Until(c.runWorker, time.Second, stopCh)
|
||||
|
@ -107,7 +107,7 @@ func (c *DynamicCertKeyPairContent) loadCertKeyPair() error {
|
||||
}
|
||||
|
||||
c.certKeyPair.Store(newCertKey)
|
||||
klog.V(2).Infof("Loaded a new cert/key pair for %q", c.Name())
|
||||
klog.V(2).InfoS("Loaded a new cert/key pair", "name", c.Name())
|
||||
|
||||
for _, listener := range c.listeners {
|
||||
listener.Enqueue()
|
||||
@ -126,8 +126,8 @@ func (c *DynamicCertKeyPairContent) Run(workers int, stopCh <-chan struct{}) {
|
||||
defer utilruntime.HandleCrash()
|
||||
defer c.queue.ShutDown()
|
||||
|
||||
klog.Infof("Starting %s", c.name)
|
||||
defer klog.Infof("Shutting down %s", c.name)
|
||||
klog.InfoS("Starting controller", "name", c.name)
|
||||
defer klog.InfoS("Shutting down controller", "name", c.name)
|
||||
|
||||
// doesn't matter what workers say, only start one.
|
||||
go wait.Until(c.runWorker, time.Second, stopCh)
|
||||
|
@ -50,7 +50,7 @@ func (c *DynamicServingCertificateController) BuildNamedCertificates(sniCerts []
|
||||
byNameExplicit[name] = &cert
|
||||
}
|
||||
|
||||
klog.V(2).Infof("loaded SNI cert [%d/%q]: %s", i, c.sniCerts[i].Name(), GetHumanCertDetail(x509Cert))
|
||||
klog.V(2).InfoS("Loaded SNI cert", "index", i, "certName", c.sniCerts[i].Name(), "certDetail", GetHumanCertDetail(x509Cert))
|
||||
if c.eventRecorder != nil {
|
||||
c.eventRecorder.Eventf(&corev1.ObjectReference{Name: c.sniCerts[i].Name()}, nil, corev1.EventTypeWarning, "TLSConfigChanged", "SNICertificateReload", "loaded SNI cert [%d/%q]: %s with explicit names %v", i, c.sniCerts[i].Name(), GetHumanCertDetail(x509Cert), names)
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ func (c *DynamicServingCertificateController) syncCerts() error {
|
||||
return fmt.Errorf("unable to load client CA file %q: %v", string(newContent.clientCA.caBundle), err)
|
||||
}
|
||||
for i, cert := range newClientCAs {
|
||||
klog.V(2).Infof("loaded client CA [%d/%q]: %s", i, c.clientCA.Name(), GetHumanCertDetail(cert))
|
||||
klog.V(2).InfoS("Loaded client CA", "index", i, "certName", c.clientCA.Name(), "certDetail", GetHumanCertDetail(cert))
|
||||
if c.eventRecorder != nil {
|
||||
c.eventRecorder.Eventf(&corev1.ObjectReference{Name: c.clientCA.Name()}, nil, corev1.EventTypeWarning, "TLSConfigChanged", "CACertificateReload", "loaded client CA [%d/%q]: %s", i, c.clientCA.Name(), GetHumanCertDetail(cert))
|
||||
}
|
||||
@ -197,7 +197,7 @@ func (c *DynamicServingCertificateController) syncCerts() error {
|
||||
return fmt.Errorf("invalid serving cert: %v", err)
|
||||
}
|
||||
|
||||
klog.V(2).Infof("loaded serving cert [%q]: %s", c.servingCert.Name(), GetHumanCertDetail(x509Cert))
|
||||
klog.V(2).InfoS("Loaded serving cert", "certName", c.servingCert.Name(), "certDetail", GetHumanCertDetail(x509Cert))
|
||||
if c.eventRecorder != nil {
|
||||
c.eventRecorder.Eventf(&corev1.ObjectReference{Name: c.servingCert.Name()}, nil, corev1.EventTypeWarning, "TLSConfigChanged", "ServingCertificateReload", "loaded serving cert [%q]: %s", c.servingCert.Name(), GetHumanCertDetail(x509Cert))
|
||||
}
|
||||
@ -237,8 +237,8 @@ func (c *DynamicServingCertificateController) Run(workers int, stopCh <-chan str
|
||||
defer utilruntime.HandleCrash()
|
||||
defer c.queue.ShutDown()
|
||||
|
||||
klog.Infof("Starting DynamicServingCertificateController")
|
||||
defer klog.Infof("Shutting down DynamicServingCertificateController")
|
||||
klog.InfoS("Starting DynamicServingCertificateController")
|
||||
defer klog.InfoS("Shutting down DynamicServingCertificateController")
|
||||
|
||||
// synchronously load once. We will trigger again, so ignoring any error is fine
|
||||
_ = c.RunOnce()
|
||||
|
Loading…
Reference in New Issue
Block a user