mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix: set correct logger in profiling server (#5358)
* fix: set correct logger in profiling server Signed-off-by: damilola olayinka <holayinkajr@gmail.com> * Update cmd/kyverno/main.go Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: damilola olayinka <holayinkajr@gmail.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
bb90bb25ba
commit
3d7fd8adc1
1 changed files with 8 additions and 2 deletions
|
@ -160,8 +160,14 @@ func startProfiling(logger logr.Logger) {
|
|||
addr := ":" + profilePort
|
||||
logger.Info("Enable profiling, see details at https://github.com/kyverno/kyverno/wiki/Profiling-Kyverno-on-Kubernetes", "port", profilePort)
|
||||
go func() {
|
||||
if err := http.ListenAndServe(addr, nil); err != nil {
|
||||
logger.Error(err, "Failed to enable profiling")
|
||||
s := http.Server{
|
||||
Addr: addr,
|
||||
Handler: nil,
|
||||
ErrorLog: logging.StdLogger(logger, ""),
|
||||
ReadHeaderTimeout: 30 * time.Second,
|
||||
}
|
||||
if err := s.ListenAndServe(); err != nil {
|
||||
logger.Error(err, "failed to enable profiling", "address", addr)
|
||||
os.Exit(1)
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Reference in a new issue