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

kubectl automatic version detection fails if there is trailing version information #37

Open
TyBrown opened this issue Dec 13, 2022 · 0 comments · May be fixed by #38
Open

kubectl automatic version detection fails if there is trailing version information #37

TyBrown opened this issue Dec 13, 2022 · 0 comments · May be fixed by #38

Comments

@TyBrown
Copy link
Contributor

TyBrown commented Dec 13, 2022

The kubectl wrapper has been having difficulties detecting the correct version of certain Kubernetes clusters, particularly those built with EKS or Okteto.

Examples of versions that are causing problems:

Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.14-eks-fb459a0", GitCommit:"b07006b2e59857b13fe5057a956e86225f0e82b7", GitTreeState:"clean", BuildDate:"2022-10-24T20:32:54Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.11-gke.300", GitCommit:"c350c382e45991555b91385de867af07ec551a3e", GitTreeState:"clean", BuildDate:"2022-09-17T18:32:27Z", GoVersion:"go1.17.13b7", Compiler:"gc", Platform:"linux/amd64"}

Errors:

$ kubectl version
fork/exec /Users/ty/.bin/kubectl-v1.21.14-eks-fb459a0: no such file or directory
fork/exec /Users/ty/.bin/kubectl-v1.23.11-gke.300: no such file or directory

So far, I've been able to work around these problems by manually symlinking the requested versions to the correct (although manually installed versions).

I believe that this line could be reworked a bit to basically trim any extraneous version information from the auto-detected Version. (I think we'd probably want to NOT trim the extra version info if it starts with -alpha, -beta, or -rc, since those are valid versions available via kbenv to download/install)

I'll start working on a draft PR for this... but I figured I'd start the conversation as an issue in case there's disagreement or additional context here that I'm missing before I get too far into it.

Cheers,
Ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant