Skip to content

[v18] Fix kube port-forward to exit on pod removal#57738

Merged
rana merged 1 commit intobranch/v18from
bot/backport-57051-branch/v18
Aug 11, 2025
Merged

[v18] Fix kube port-forward to exit on pod removal#57738
rana merged 1 commit intobranch/v18from
bot/backport-57051-branch/v18

Conversation

@rana
Copy link
Copy Markdown
Contributor

@rana rana commented Aug 9, 2025

Backport #57051 to branch/v18

changelog: Kubernetes Access: kubectl port-forward now exits cleanly when backend pods are removed

@rana rana enabled auto-merge August 10, 2025 03:30
`kubectl port-forward` now exits when a pod disconnects. This addresses `kubectl` user expectations that the Teleport Kubernetes proxy behave transparently, and identical to direct-to-Kubernetes.

- Changed error stream copying to uni-directional (target -> source) in SPDY and WebSocket `forwardStreamPair()` functions
- Added `WaitGroup` to SPDY `run()` enabling all port-forward streams to fully complete before returning
- Added an integration test for Kubernetes port-forwarding with pod disconnection
- Updated existing port-forward integration tests to allow and expect `ErrLostConnectionToPod`

Fixes #54814
@rana rana force-pushed the bot/backport-57051-branch/v18 branch from ee64819 to b081795 Compare August 10, 2025 03:30
@rana rana added this pull request to the merge queue Aug 11, 2025
Merged via the queue into branch/v18 with commit 80c8ae2 Aug 11, 2025
40 checks passed
@rana rana deleted the bot/backport-57051-branch/v18 branch August 11, 2025 12:22
@doggydogworld doggydogworld mentioned this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants