mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 11:12:03 +00:00
Migrate cmd/kubelet, image, cadvisor and cri to structured logging
This commit is contained in:
@@ -43,16 +43,16 @@ func appendPluginBasedOnFeatureFlags(plugins []volume.VolumePlugin, inTreePlugin
|
||||
migrationComplete, err := csimigration.CheckMigrationFeatureFlags(featureGate, pluginInfo.pluginMigrationFeature,
|
||||
pluginInfo.pluginMigrationCompleteFeature, pluginInfo.pluginUnregisterFeature)
|
||||
if err != nil {
|
||||
klog.Warningf("Unexpected CSI Migration Feature Flags combination detected: %v. CSI Migration may not take effect", err)
|
||||
klog.InfoS("Unexpected CSI Migration Feature Flags combination detected, CSI Migration may not take effect", "err", err)
|
||||
// TODO: fail and return here once alpha only tests can set the feature flags for a plugin correctly
|
||||
}
|
||||
// TODO: This can be removed after feature flag CSIMigrationvSphereComplete is removed.
|
||||
if migrationComplete {
|
||||
klog.Infof("Skip registration of plugin %s since migration is complete", inTreePluginName)
|
||||
klog.InfoS("Skipped registration of plugin since migration is completed", "pluginName", inTreePluginName)
|
||||
return plugins, nil
|
||||
}
|
||||
if featureGate.Enabled(pluginInfo.pluginUnregisterFeature) {
|
||||
klog.Infof("Skip registration of plugin %s since feature flag %v is enabled", inTreePluginName, pluginInfo.pluginUnregisterFeature)
|
||||
klog.Infof("Skipped registration of plugin since feature flag is enabled", "pluginName", inTreePluginName, "featureFlag", pluginInfo.pluginUnregisterFeature)
|
||||
return plugins, nil
|
||||
}
|
||||
|
||||
|
@@ -24,19 +24,19 @@ import (
|
||||
func watchForLockfileContention(path string, done chan struct{}) error {
|
||||
watcher, err := inotify.NewWatcher()
|
||||
if err != nil {
|
||||
klog.Errorf("unable to create watcher for lockfile: %v", err)
|
||||
klog.ErrorS(err, "Unable to create watcher for lockfile")
|
||||
return err
|
||||
}
|
||||
if err = watcher.AddWatch(path, inotify.InOpen|inotify.InDeleteSelf); err != nil {
|
||||
klog.Errorf("unable to watch lockfile: %v", err)
|
||||
klog.ErrorS(err, "Unable to watch lockfile")
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
select {
|
||||
case ev := <-watcher.Event:
|
||||
klog.Infof("inotify event: %v", ev)
|
||||
klog.InfoS("inotify event", "event", ev)
|
||||
case err = <-watcher.Error:
|
||||
klog.Errorf("inotify watcher error: %v", err)
|
||||
klog.ErrorS(err, "inotify watcher error")
|
||||
}
|
||||
close(done)
|
||||
}()
|
||||
|
Reference in New Issue
Block a user