Skip to content

Conversation

@nojnhuh
Copy link
Contributor

@nojnhuh nojnhuh commented Sep 12, 2025

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

When an SSH command fails in e2e, there isn't much context that shows up in logs, e.g. from #5844 (comment):

Failed to get logs for Machine capz-06jj60-md-0-xdh7f-vv66g, Cluster default/capz-06jj60: running command "cat /var/log/calico/cni/cni.log": Process exited with status 1

This PR adds the stderr from the command to the error message:

Failed to get logs for Machine capz-e2e-r6cvnq-aso-md-0-ktznl-zvxdx, Cluster capz-e2e-r6cvnq/capz-e2e-r6cvnq-aso: running command "cat /var/log/calico/cni/cni.log": Process exited with status 1, stderr: cat: /var/log/calico/cni/cni.log: Permission denied

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • cherry-pick candidate

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 12, 2025
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 12, 2025
@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.93%. Comparing base (c11dab9) to head (6fbd5bf).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5868      +/-   ##
==========================================
- Coverage   46.94%   46.93%   -0.01%     
==========================================
  Files         279      279              
  Lines       29687    29687              
==========================================
- Hits        13936    13934       -2     
- Misses      14938    14940       +2     
  Partials      813      813              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 12, 2025
var stdoutBuf bytes.Buffer
session.Stdout = &stdoutBuf
var stderrBuf bytes.Buffer
session.Stdout = f
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Getting rid of the intermediate stdoutBuf is a drive-by optimization to save us from holding onto the entire file content in memory before writing it to the file.

@nojnhuh nojnhuh mentioned this pull request Sep 12, 2025
4 tasks
@marosset
Copy link
Contributor

/approve

@nojnhuh
Copy link
Contributor Author

nojnhuh commented Sep 12, 2025

/retest

@nojnhuh
Copy link
Contributor Author

nojnhuh commented Sep 12, 2025

#5690

/retest

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 12, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 3416a12d3352b66c3b61f0b44954801300442b63

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marosset, mboersma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 12, 2025
@k8s-ci-robot k8s-ci-robot merged commit 6b442a0 into kubernetes-sigs:main Sep 12, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in CAPZ Planning Sep 12, 2025
@nojnhuh nojnhuh deleted the e2e-ssh-stderr branch September 12, 2025 21:20
@nojnhuh nojnhuh added this to the v1.22 milestone Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants