Revert TerminalSize type duplication, use shared types
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
PR #133367 duplicated TerminalSize and TerminalSizeQueue types between kubectl/pkg/util/term and client-go/tools/remotecommand to avoid heavy dependencies. However, these types themselves have zero dependencies - only other files in the remotecommand package use websocket/spdystream.
This duplication broke downstream consumers that use both packages (e.g., cri-tools), requiring workarounds: https://github.com/kubernetes-sigs/cri-tools/pull/1955/files#diff-c72419df07499621d9866069c71e99656016c3149f71040424b8bd1af4e7ec07L430-R452
This change moves the types to k8s.io/apimachinery/pkg/util/remotecommand (which already contains remotecommand protocol constants) and updates both kubectl and client-go to use type aliases. This eliminates duplication while achieving the original goal of package decoupling.
Which issue(s) this PR is related to:
Refers to https://github.com/kubernetes-sigs/cri-tools/pull/1955
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?
None
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
None
Please note that we're already in Test Freeze for the release-1.35 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.35.0 release.
Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Thu Dec 4 09:39:52 UTC 2025.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: saschagrunert Once this PR has been reviewed and has the lgtm label, please assign apelisse, seans3 for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
- staging/src/k8s.io/apimachinery/pkg/util/OWNERS
- staging/src/k8s.io/client-go/tools/remotecommand/OWNERS
- staging/src/k8s.io/kubectl/OWNERS
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
cc @ash2k @soltysh
@saschagrunert: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-kubernetes-apidiff-client-go | 846cd35e99e3d9f4805ec17a0925dd772b0f8258 | link | false | /test pull-kubernetes-apidiff-client-go |
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.
@soltysh I wonder if this breakage of consumers may justify the cherry-pick to 1.35.
/triage accepted
FWIW I'm ok with this, but at the same time conceptually these are different things. Yes, today these types contain the same fields, but is it possible that in the future they may not be identical?
Honestly, if we're considering a revert I'd be more comfortable reverting to a state before https://github.com/kubernetes/kubernetes/pull/133367 rather than introducing what is proposed in this PR.
@soltysh I wonder if this breakage of consumers may justify the cherry-pick to 1.35.
That's a reasonable ask, let's sync on slack about the shape of this PR, and figure out the path forward with the release team.
Based on the conversation on slack we've decided that a revert is not needed, the required adapter is not that big of a problem. We might consider implementing aliases, but that's not big rush.
Based on the above, I'm going to close this PR.
/close
@soltysh: Closed this PR.
In response to this:
Based on the conversation on slack we've decided that a revert is not needed, the required adapter is not that big of a problem. We might consider implementing aliases, but that's not big rush.
Based on the above, I'm going to close this PR.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.