Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hrivera-ntap opened this issue Jun 17, 2024 · 2 comments
Labels
area/cli bugs related to kaniko CLI area/logging For all bugs related to logging good first issue Good for newcomers help wanted Looking for a volunteer! kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy

Comments

@hrivera-ntap
Copy link

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:

case FormatText:
formatter = &logrus.TextFormatter{
DisableColors: true,
FullTimestamp: logTimestamp,
}
case FormatColor:
formatter = &logrus.TextFormatter{
ForceColors: true,
FullTimestamp: logTimestamp,
}

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
@silverkorn
Copy link

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

@aaron-prindle aaron-prindle added kind/bug Something isn't working area/cli bugs related to kaniko CLI good first issue Good for newcomers help wanted Looking for a volunteer! priority/p1 Basic need feature compatibility with docker build. we should be working on this next. priority/p2 High impact feature/bug. Will get a lot of users happy area/logging For all bugs related to logging and removed priority/p1 Basic need feature compatibility with docker build. we should be working on this next. labels Jul 16, 2024
@hrivera-ntap
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli bugs related to kaniko CLI area/logging For all bugs related to logging good first issue Good for newcomers help wanted Looking for a volunteer! kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants