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

Stream output from KubeExec #1037

Closed
wants to merge 2 commits into from
Closed

Stream output from KubeExec #1037

wants to merge 2 commits into from

Conversation

tdmanv
Copy link
Contributor

@tdmanv tdmanv commented Jun 30, 2021

Change Overview

Re-implementation of https://github.com/kanisterio/kanister/pull/257/files, but correctly handles stderr-only output. That PR would hang if only stderr was returned and stdout was empty.

In follow-ups, we'll plumb the reader to the caller so it can be parsed.

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

Added test times out on original change https://github.com/kanisterio/kanister/pull/257/files

~/src/kanister/pkg/kube/ go test -v -check.v -check.f TestStderr
=== RUN   Test
PASS: exec_test.go:80: ExecSuite.TestStderr     0.360s
OK: 1 passed
--- PASS: Test (4.11s)
PASS
ok      github.com/kanisterio/kanister/pkg/kube 4.123s
  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

return strings.TrimSpace(stdout.String()), strings.TrimSpace(stderr.String()), err
pro, pwo := io.Pipe()
pre, pwe := io.Pipe()
errCh := make(chan error, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of errCh here? It is not referenced out of the goroutine below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - this is not needed

@PrasadG193 PrasadG193 mentioned this pull request Jan 18, 2022
10 tasks
@shuguet shuguet added this to In Progress in Kanister via automation Mar 25, 2022
@shuguet shuguet moved this from In Progress to Review Required in Kanister Mar 25, 2022
@ihcsim
Copy link
Contributor

ihcsim commented May 5, 2022

Superseded by #1331.

@ihcsim ihcsim closed this May 5, 2022
Kanister automation moved this from Review Required to Done May 5, 2022
@ihcsim ihcsim deleted the kube-exec-stream branch May 5, 2022 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants