Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete for kubectl version 1.22.0 does not work with exec -it option #1096

Closed
eugene-marchanka opened this issue Aug 11, 2021 · 2 comments · Fixed by kubernetes/kubernetes#103448
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@eugene-marchanka
Copy link

What happened:
autocomplete for kubectl version 1.22.0 does not work with exec -it option:

  • kubectl exec -it <tab_to_see_pods> - does not show pods
  • kubectl exec <tab_to_see_pods> -it -- bash - shows pods

What you expected to happen:
autocomplete for kubectl version 1.21.3 works fine with exec -it option:

  • k exec -it <tab_to_see_pods> - shows pods list

How to reproduce it (as minimally and precisely as possible):

  1. Install kubectl version 1.22.0 and try:
kubectl exec -it <tab_to_see_pods>
  1. Install kubectl version 1.21.3 and try:
kubectl exec -it <tab_to_see_pods>

Anything else we need to know?:

Environment:

  • Kubernetes client and server versions (use kubectl version):
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.0", GitCommit:"c2b5237ccd9c0f1d600d3072634ca66cefdf272f", GitTreeState:"clean", BuildDate:"2021-08-04T18:03:20Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.7-eks-d88609", GitCommit:"d886092805d5cc3a47ed5cf0c43de38ce442dfcb", GitTreeState:"clean", BuildDate:"2021-07-31T00:29:12Z", GoVersion:"go1.15.12", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.22) and server (1.20) exceeds the supported minor version skew of +/-1
  • Cloud provider or hardware configuration:
    AWS/GCP/Baremetal
  • OS (e.g: cat /etc/os-release):
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
@eugene-marchanka eugene-marchanka added the kind/bug Categorizes issue or PR as related to a bug. label Aug 11, 2021
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 11, 2021
@lauchokyip
Copy link
Member

lauchokyip commented Aug 12, 2021

It's expected, check kubernetes/kubernetes#96087

Regression:
Custom completions don't work following concatenated short flags, e.g., kubectl exec -it .
This will be fixed in the next Cobra release: spf13/cobra#1258

For the time being, can you try

kubectl exec -i -t <pod>

based on this comment, spf13/cobra#1258 (comment)

@eddiezane
Copy link
Member

Thanks for reporting and sorry you ran into this.

As Lau pointed out this was introduced by our migration to Go based completion. We should be able to get this fixed soon.

Tracking updating Cobra here kubernetes/kubernetes#103448.

/triage accepted
/priority backlog

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants