microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.71k stars 1.4k forks source link

[kubernetes-helm] zsh completion is not working #1511

Open ijaouani opened 2 years ago

ijaouani commented 2 years ago

Steps to Reproduce:

  1. Create an empty folder locally

  2. Open the folder with vscode and apply "Kubernetes - Local Configuration" without any features

    image
  3. Reopen in container

  4. Wait for it to build

  5. Open a zsh terminal

  6. Write "kubectl g" and tab

  7. Nothing happen

Investigations :

  1. Bash completion is working
  2. The relevant code is in kubectl-helm-debian.sh :
# kubectl bash completion
kubectl completion bash > /etc/bash_completion.d/kubectl

# kubectl zsh completion
if [ -e "${USERHOME}}/.oh-my-zsh" ]; then
    mkdir -p "${USERHOME}/.oh-my-zsh/completions"
    kubectl completion zsh > "${USERHOME}/.oh-my-zsh/completions/_kubectl"
    chown -R "${USERNAME}" "${USERHOME}/.oh-my-zsh"
fi
  1. We don't enter the if statement (I have checked with echo) that's why it's not working.
  2. I can reproduce the same issue when creating a devcontainer using Ubuntu definition and using the feature :
"features": {
        "kubectl-helm-minikube": {
            "version": "latest",
            "helm": "latest",
            "minikube": "none"
        },
}
bamurtaugh commented 2 years ago

Thanks for opening @ijaouani. Upon initial read, it sounds like this could be an issue with the Remote-Containers extension specifically?

cc @chrmarti @joshspicer for thoughts

ijaouani commented 2 years ago

For me this is just a bug here.