Skip to content

Fix exec stream: remove stdin from Exec URL and StreamWithContext - #1

Closed
azemoning wants to merge 1 commit into
masterfrom
fix/exec-stream-stdin
Closed

azemoning wants to merge 1 commit into
masterfrom
fix/exec-stream-stdin

Conversation

@azemoning

@azemoning azemoning commented Jul 11, 2026 •

Copy link
Copy Markdown
Owner

Problem

The exec stream wasn't producing any data. When spe created an ephemeral container and exec'd tcpdump into it, the pcap file was always 0 bytes, even though tcpdump was running and traffic was flowing.

Root cause

The Exec method had stdin=true in the URL parameters. When StreamWithContext was called with io.NopCloser(bytes.NewReader(nil)) as stdin, the SPDY connection received EOF on stdin immediately, which caused the connection to close before any stdout data could flow.

Fix

  • Removed stdin=true from the Exec URL parameters in internal/k8s/client.go
  • Removed Stdin from the StreamWithContext call in internal/capture/ephemeral.go
  • Increased ephemeral container wait timeout from 30s to 120s for clusters that need to pull the debug image

Testing

Verified on kind cluster:

  • Single pod capture: 230 bytes captured (was 0 bytes before fix)
  • Inventory traffic: 2552 bytes captured
  • Payment traffic: 2496 bytes captured
  • DNS traffic: 895 bytes captured

The stdin=true parameter in the exec URL caused the SPDY connection to
close when stdin sent EOF (from io.NopCloser). Removing stdin from both
the URL and StreamWithContext fixes the capture.

Also increased ephemeral container wait timeout from 30s to 120s for
clusters that need to pull the debug image.
@azemoning
azemoning deleted the branch master July 11, 2026 15:53
@azemoning azemoning closed this Jul 11, 2026
@azemoning
azemoning deleted the fix/exec-stream-stdin branch July 11, 2026 15:55
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.

1 participant