Skip to content

[v16] Fix kube port-forward to exit on pod removal#57741

Merged
rosstimothy merged 1 commit intobranch/v16from
rana/backport-57051-branch/v16
Aug 11, 2025
Merged

[v16] Fix kube port-forward to exit on pod removal#57741
rosstimothy merged 1 commit intobranch/v16from
rana/backport-57051-branch/v16

Conversation

@rana
Copy link
Copy Markdown
Contributor

@rana rana commented Aug 9, 2025

Backport #57051 to branch/v16

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/v16 branch from 8dcbd09 to 9cf50f8 Compare August 10, 2025 01:52
@rana rana enabled auto-merge August 10, 2025 03:30
@rana rana added this pull request to the merge queue Aug 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 11, 2025
@rosstimothy rosstimothy added this pull request to the merge queue Aug 11, 2025
Merged via the queue into branch/v16 with commit 5aaf889 Aug 11, 2025
38 checks passed
@rosstimothy rosstimothy deleted the rana/backport-57051-branch/v16 branch August 11, 2025 14:50
@fheinecke fheinecke mentioned this pull request Sep 2, 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.

4 participants