mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #100877 from lojies/schedulerlogstructured
Structured Logging migration: modify logs of kube-scheduler
This commit is contained in:
commit
89056f66c8
@ -69,7 +69,7 @@ func LogOrWriteConfig(fileName string, cfg *kubeschedulerconfig.KubeSchedulerCon
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
configString := string(bytes)
|
configString := string(bytes)
|
||||||
klog.Infof("Using component config:\n%+v\n", configString)
|
klog.InfoS("Using component config", "config", configString)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(fileName) > 0 {
|
if len(fileName) > 0 {
|
||||||
@ -81,7 +81,7 @@ func LogOrWriteConfig(fileName string, cfg *kubeschedulerconfig.KubeSchedulerCon
|
|||||||
if err := encoder.Encode(cfg, configFile); err != nil {
|
if err := encoder.Encode(cfg, configFile); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
klog.Infof("Wrote configuration to: %s\n", fileName)
|
klog.InfoS("Wrote configuration", "file", fileName)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -135,7 +135,7 @@ func runCommand(cmd *cobra.Command, opts *options.Options, registryOptions ...Op
|
|||||||
// Run executes the scheduler based on the given configuration. It only returns on error or when context is done.
|
// Run executes the scheduler based on the given configuration. It only returns on error or when context is done.
|
||||||
func Run(ctx context.Context, cc *schedulerserverconfig.CompletedConfig, sched *scheduler.Scheduler) error {
|
func Run(ctx context.Context, cc *schedulerserverconfig.CompletedConfig, sched *scheduler.Scheduler) error {
|
||||||
// To help debugging, immediately log version
|
// To help debugging, immediately log version
|
||||||
klog.V(1).Infof("Starting Kubernetes Scheduler version %+v", version.Get())
|
klog.V(1).InfoS("Starting Kubernetes Scheduler version", "version", version.Get())
|
||||||
|
|
||||||
// Configz registration.
|
// Configz registration.
|
||||||
if cz, err := configz.New("componentconfig"); err == nil {
|
if cz, err := configz.New("componentconfig"); err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user