pipeline
pipeline copied to clipboard
Fix no logs in stdout/stderr if uses stdoutConfig
Changes
fix #6136 used to only collect stdout and err to a file if the std{out/err}Path is specified, now add both os.std{out/err} and the std{out/err}Path to multiwriter to collect logs.
there is a full test to verify the function, now if you run the test TestRealRunnerStdoutAndStderrPaths
you can see that the standard output has a log, there was no before
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- [x] Has Docs included if any changes are user facing
- [x] Has Tests included if any functionality added or changed
- [x] Follows the commit message standard
- [x] Meets the Tekton contributor standards (including functionality, content, code)
- [x] Has a kind label. You can add one by adding a comment on this PR that contains
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep - [ ] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
- [ ] Release notes contains the string "action required" if the change requires additional action from users switching to the new release
Release Notes
NONE
/kind bug
/assign @wlynch could you please take a review?π
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
cmd/entrypoint/runner.go | 82.8% | 83.3% | 0.5 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
cmd/entrypoint/runner.go | 82.8% | 85.2% | 2.4 |
This will probably need a
release-note
entry πΌπΌ
thanks @vdemeester , i added the release-note
and marked the release-note
checklist
/test pull-tekton-pipeline-integration-tests
@chengjoey thanks for this fix.
As you pointed out, there is a test for this, which was already succeeding, which unfortunately means there is full coverage for this change - it could be inadvertently broken again and the tests would not catch it.
Would it be possible to add test coverage to make sure we do not lose pod logs when using stdoutConfig
?
@wlynch it would be nice if you could review this one since you changed this code last π
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
cmd/entrypoint/runner.go | 84.4% | 83.3% | -1.0 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
cmd/entrypoint/runner.go | 84.4% | 85.2% | 0.8 |
@chengjoey thanks for this fix.
As you pointed out, there is a test for this, which was already succeeding, which unfortunately means there is full coverage for this change - it could be inadvertently broken again and the tests would not catch it. Would it be possible to add test coverage to make sure we do not lose pod logs when using
stdoutConfig
?
Of course, i added verification in TestRealRunnerStdoutAndStderrPaths
that whether realRunner
print the log to std{out/err}. Thanks for the reminder, your advice is great!
/test pull-tekton-pipeline-alpha-integration-tests
/assign
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: vdemeester, Yongxuanzhang
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [vdemeester]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
/lgtm
@chengjoey @pritidesai @jerop should this be cherry-picked in the latest LTS ? (0.41 and 0.44)
/cherry-pick release-v0.41.x /cherry-pick release-v0.42.x /cherry-pick release-v0.43.x /cherry-pick release-v0.44.x
@chengjoey: #6162 failed to apply on top of branch "release-v0.41.x":
Applying: Fix no logs in stdout/stderr if uses stdoutConfig
Using index info to reconstruct a base tree...
M cmd/entrypoint/runner.go
M cmd/entrypoint/runner_test.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/entrypoint/runner_test.go
CONFLICT (content): Merge conflict in cmd/entrypoint/runner_test.go
Auto-merging cmd/entrypoint/runner.go
CONFLICT (content): Merge conflict in cmd/entrypoint/runner.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix no logs in stdout/stderr if uses stdoutConfig
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to this:
/cherry-pick release-v0.41.x /cherry-pick release-v0.42.x /cherry-pick release-v0.43.x /cherry-pick release-v0.44.x
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
@chengjoey @pritidesai @jerop should this be cherry-picked in the latest LTS ? (0.41 and 0.44)
when i try to cherry-pick to 0.41, there are some conflicts, I manually submitted a hotfix pr, is this the correct hotfix process
/cherry-pick release-v0.44.x
@chengjoey: new pull request created: #6506
In response to this:
/cherry-pick release-v0.44.x
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.