kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

The `--log-timestamp=false` option does not properly pass down `TextFormatter` into `logrus.TextFormatter`

Open hrivera-ntap opened this issue 1 year ago • 2 comments

Actual behavior When passing in --log-timestamp=false with either --log-format=text|color set, timestamps still get logged.

Expected behavior No timestamps should get logged

To Reproduce Steps to reproduce the behavior:

  1. Pass in --log-timestamp=false and --log-format=text and notice timestamps still get logged.

Additional Information

  • Kaniko Image v1.23.1

Triage Notes for the Maintainers

The culprit appears to be here: https://github.com/GoogleContainerTools/kaniko/blob/6bea4df3afb81106f31ebae979c26b64b5e800fb/pkg/logging/logging.go#L50-L59

This code should be utilizing the DisableTimestamp field instead of the FullTimestamp field in the logrus text formatter. See below: https://github.com/sirupsen/logrus/blob/dd1b4c2e81afc5c255f216a722b012ed26be57df/text_formatter.go#L48-L50

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [ ]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

hrivera-ntap avatar Jun 17 '24 23:06 hrivera-ntap

Was the closing of this PR due to something in particular?

silverkorn avatar Jun 25 '24 19:06 silverkorn

Was the closing of this PR due to something in particular?

I felt my solution was too simplistic since perhaps the bug has ventured into "it's a feature now" territory.

hrivera-ntap avatar Jul 18 '24 15:07 hrivera-ntap