Skip to content

Commit

Permalink
fix(sendconfig) suppress deck diff logs at info
Browse files Browse the repository at this point in the history
Disable deck's full diff output at log level info and above. diffs will
only print at debug or trace.
  • Loading branch information
rainest committed Apr 19, 2022
1 parent e967848 commit 6dff89e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@
[#2389](https://github.com/Kong/kubernetes-ingress-controller/issues/2389)

#### Fixed

- Added a mechanism to retry the initial connection to the Kong
Admin API on controller start to fix an issue where the controller
pod could crash loop on start when waiting for Gateway readiness
(e.g. if the Gateway is waiting for its database to initialize).
The new retry mechanism can be manually configured using the
`--kong-admin-init-retries` and `--kong-admin-init-retry-delay` flags.
[#2274](https://github.com/Kong/kubernetes-ingress-controller/issues/2274)
- diff logging now honors log level instead of printing at all log levels. It
will only print at levels `debug` and `trace`.
[#2422](https://github.com/Kong/kubernetes-ingress-controller/issues/2422)

## [2.3.1]

Expand Down
6 changes: 6 additions & 0 deletions internal/manager/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/bombsimon/logrusr/v2"
"github.com/go-logr/logr"
"github.com/kong/deck/cprint"
"github.com/kong/go-kong/kong"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -43,6 +44,11 @@ func setupLoggers(c *Config) (logrus.FieldLogger, logr.Logger, error) {
logger := logrusr.New(deprecatedLogger)
ctrl.SetLogger(logger)

if c.LogLevel != "trace" && c.LogLevel != "debug" {
// disable deck's per-change diff output
cprint.DisableOutput = true
}

return deprecatedLogger, logger, nil
}

Expand Down

0 comments on commit 6dff89e

Please sign in to comment.