-
Notifications
You must be signed in to change notification settings - Fork 3k
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
AKS Get-Credentials doesn't handle KUBECONFIG with multiple files #18836
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm. Issue DetailsDescribe the bug When a user's As per the official documentation this colon-delimited format is explicitly supported on Mac and Linux. This behaviour appears to have been introduced by #18704 and is present in v2.26.0 and above. e.g. If my
Then when I run To Reproduce $ KUBECONFIG=/home/me/.kube/config:/home/me/.kube/anotherconfig
$ az aks get-credentials ...
$ cat "/home/me/.kube/config:/home/me/.kube/anotherconfig" Expected behavior
Environment summary Install method: homebrew
Additional Context N/A
|
route to service team |
@paddycarey The official docs provide no guidance on how multiple files have to be handled. What's the point of having multiple files on |
When working with a bunch of different clusters on multiple projects for example, some people prefer to manage them in different physical config files. |
I see, I can work on fixing this, it's just that I'm not sure what behavior it should have in terms of deciding which file to use within the |
Yeah I see the issue now. There's no real solution without making certain assumptions. What bothers me is that it now writes to the literal value like |
The reason I introduced the change for checking |
Unsure what other tools do, but I noticed that the
Perhaps similar behaviour would work well here too? |
Describe the bug
When a user's
KUBECONFIG
environment variable contains more than one file, thenaz aks get-credentials...
mistakenly treats the value as a single path.As per the official documentation this colon-delimited format is explicitly supported on Mac and Linux.
This behaviour appears to have been introduced by #18704 and is present in v2.26.0 and above.
e.g.
If my
KUBECONFIG
looks like so:KUBECONFIG=/home/me/.kube/config:/home/me/.kube/anotherconfig:/home/me/.kube/yetanotherconfig
Then when I run
az aks get-credentials...
then it will attempt to write the file to a file at the path/home/me/.kube/config:/home/me/.kube/anotherconfig:/home/me/.kube/yetanotherconfig
rather than one of the single files contained within.To Reproduce
$ KUBECONFIG=/home/me/.kube/config:/home/me/.kube/anotherconfig $ az aks get-credentials ... $ cat "/home/me/.kube/config:/home/me/.kube/anotherconfig"
Expected behavior
az aks get-credentials...
should write AKS credentials to one of the files contained withinKUBECONFIG
only, but not sure how it should choose which to use.Environment summary
Install method: homebrew
Mac Version: 11.4
Additional Context
N/A
The text was updated successfully, but these errors were encountered: