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

Allow log stripping to tolerate a missing stream identifier. #444

Merged
merged 4 commits into from
Jul 22, 2019

Conversation

rabbah
Copy link
Member

@rabbah rabbah commented Jun 26, 2019

This PR allows log stripping to tolerate a missing log stream identifier. With the standalone controller, the stdout or stderr stream identifier is not readily available. This defeats the current regex matcher and logs are not stripped as a result. The patch corrects this.

Also closes #443.

@rabbah
Copy link
Member Author

rabbah commented Jun 26, 2019

This PR should fail because a unit test fails. A second commit will correct this but I want to address #443 first and will do so as part of this PR.

commands/util.go Outdated
// the timestamp expected format is YYYY-MM-DDTHH:MM:SS.[0-9]+Z
// an optional " stdout" or " stderr" stream identifier
// and the rest as the log line
regex := regexp.MustCompile("\\d{4}-[01]{1}\\d{1}-[0-3]{1}\\d{1}T[0-2]{1}\\d{1}:[0-6]{1}\\d{1}:[0-6]{1}\\d{1}.\\d+Z( (stdout|stderr):)?\\s(.*)")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this regex does make a semantic change.
previously, the following line

anything stdout: this is stdout
would be stripped to
this is stdout

but with this patch the line will remain intact.

@rabbah
Copy link
Member Author

rabbah commented Jun 26, 2019

Added unit tests to travis in one of the commits.

@rabbah rabbah requested a review from chetanmeh June 30, 2019 13:20
@chetanmeh chetanmeh merged commit d75e6d9 into apache:master Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go unit tests are not running in travis
2 participants