From ea8cc197c2b5e616b3a4b465d99ae28be0bda6a7 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Sat, 28 May 2022 20:10:17 +0200 Subject: [PATCH] fix: Refactor adapter startup to ensure proper log initilization (#3063) --- CHANGELOG.md | 4 ++++ adapter/main.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30070038ca0..66cc2a53f19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,10 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md - **General:** Use metricName from GetMetricsSpec in ScaledJobs instead of `queueLength` ([#3032](https://github.com/kedacore/keda/issue/3032)) +### Fixes + +- **General:** Refactor adapter startup to ensure proper log initilization. ([2316](https://github.com/kedacore/keda/issues/2316)) + ### Deprecations - TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) diff --git a/adapter/main.go b/adapter/main.go index 2e3eaec9b79..9fea8f1a02a 100644 --- a/adapter/main.go +++ b/adapter/main.go @@ -172,8 +172,6 @@ func main() { defer klog.Flush() klog.InitFlags(nil) - printVersion() - cmd := &Adapter{} cmd.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(scheme.Scheme)) cmd.OpenAPIConfig.Info.Title = "keda-adapter" @@ -189,6 +187,8 @@ func main() { return } + printVersion() + ctrl.SetLogger(logger) // default to 3 seconds if they don't pass the env var