Migrate pkg/kubelet/config to structured logging

Co-authored-by: Shubheksha <shubheksha@users.noreply.github.com>

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

Co-authored-by: Elana Hashman <ehashman@users.noreply.github.com>
This commit is contained in:
afrouz
2021-03-09 14:30:10 +03:30
parent 23d4b3b4f0
commit 27a99045e5
5 changed files with 29 additions and 29 deletions

View File

@@ -57,7 +57,7 @@ func (s *sourceFile) startWatch() {
}
if err := s.doWatch(); err != nil {
klog.Errorf("Unable to read config path %q: %v", s.path, err)
klog.ErrorS(err, "Unable to read config path", "path", s.path)
if _, retryable := err.(*retryableError); !retryable {
backOff.Next(backOffID, time.Now())
}
@@ -102,7 +102,7 @@ func (s *sourceFile) doWatch() error {
func (s *sourceFile) produceWatchEvent(e *fsnotify.Event) error {
// Ignore file start with dots
if strings.HasPrefix(filepath.Base(e.Name), ".") {
klog.V(4).Infof("Ignored pod manifest: %s, because it starts with dots", e.Name)
klog.V(4).InfoS("Ignored pod manifest, because it starts with dots", "eventName", e.Name)
return nil
}
var eventType podEventType