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

Change format.Writer to not format phase output log lines #1431

Merged
merged 2 commits into from
May 6, 2022

Conversation

ihcsim
Copy link
Contributor

@ihcsim ihcsim commented May 6, 2022

Change Overview

This PR fixes a string-matching bug that caused phase outputs to fail to
be marshalled in some cases.

When kube.ExecOutput() writes the remote stdout/stderr outputs to the
user-provided writers, it calls format.Writer() to format the outputs
to the Kanister-log format. This causes the "phase output" to be
prepended with log metadata such as log timestamp, caller function etc.

A previous attempt to expand the output.Parse() function regex to handle
these log metadata prefixes has caused some downstream failures.

This fix reverts to the previous implementation of output.Parse(). It
also updates the format.Writer() to not format any "phase output".

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

When kube.ExecOutput() writes the remote stdout/stderr outputs to the
user-provided writers, it calls format.Writer() to format the outputs
to the Kanister-log format. This causes the "phase output" to be
prepended with log metadata such as log timestamp, caller function etc.

A previous attempt to expand the output.Parse() function regex to handle
these log metadata prefixes has caused some downstream failures.

This fix reverts to the previous implementation of output.Parse(). It
also updates the format.Writer() to not format any "phase output".

Signed-off-by: Ivan Sim <ivan.sim@kasten.io>
@ihcsim ihcsim requested a review from pavannd1 May 6, 2022 19:20
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2022

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister May 6, 2022
Kanister automation moved this from In Progress to Reviewer approved May 6, 2022
@ihcsim ihcsim added the kueue label May 6, 2022
@mergify mergify bot merged commit a1d4240 into master May 6, 2022
Kanister automation moved this from Reviewer approved to Done May 6, 2022
@mergify mergify bot deleted the fix-output-parse branch May 6, 2022 20:56
akankshakumari393 pushed a commit that referenced this pull request May 9, 2022
When kube.ExecOutput() writes the remote stdout/stderr outputs to the
user-provided writers, it calls format.Writer() to format the outputs
to the Kanister-log format. This causes the "phase output" to be
prepended with log metadata such as log timestamp, caller function etc.

A previous attempt to expand the output.Parse() function regex to handle
these log metadata prefixes has caused some downstream failures.

This fix reverts to the previous implementation of output.Parse(). It
also updates the format.Writer() to not format any "phase output".

Signed-off-by: Ivan Sim <ivan.sim@kasten.io>

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants