Skip to content

[v17] Fix kube port-forward to exit on pod removal#57742

Merged
rana merged 1 commit intobranch/v17from
rana/backport-57051-branch/v17
Aug 11, 2025
Merged

[v17] Fix kube port-forward to exit on pod removal#57742
rana merged 1 commit intobranch/v17from
rana/backport-57051-branch/v17

Conversation

@rana
Copy link
Copy Markdown
Contributor

@rana rana commented Aug 9, 2025

Backport #57051 to branch/v17

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

`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 rana/backport-57051-branch/v17 branch from 4a55725 to 8889d3c Compare August 10, 2025 01:50
@rana rana enabled auto-merge August 10, 2025 03:30
@rana rana added this pull request to the merge queue Aug 11, 2025
Merged via the queue into branch/v17 with commit 180825f Aug 11, 2025
38 checks passed
@rana rana deleted the rana/backport-57051-branch/v17 branch August 11, 2025 12:06
@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