az aks get-credentials fails when env:KUBECONFIG is set with windows paths
See original GitHub issueThis is autogenerated. Please review and update as needed.
Describe the bug
az aks get-credentials
fails when env:KUBECONFIG is set with windows paths
Command Name
az aks get-credentials
Errors:
Merged "ss-locn-dev-tst-aks001" as current context in C
To Reproduce:
When the environment variable KUBECONFIG is set to
- %USERPROFILE%.kube\config;%USERPROFILE%.kube\k8stest.config or
- %USERPROFILE%.kube\config
az aks get-credentials
fails but produces truncated output as follows -Merged "ss-locn-dev-tst-aks001" as current context in C
If I change environment variable KUBECONFIG to
- ~/.kube/config
Then the command finishes successfully and the config file is produced successfully output is as follows:
Merged "ss-locn-dev-tst-aks001" as current context in ~/.kube/config
However kubectl config get-contexts
only lists the Azure hosted cluster and not my local or vmware hosted cluster.
if I then change environment variable KUBECONFIG back to
-
%USERPROFILE%.kube\config;%USERPROFILE%.kube\k8stest.config Then
kubectl config get-contexts
lists all of the contexts correctly -
Put any pre-requisite steps here…
-
az aks get-credentials --resource-group {} --name {}
Expected Behavior
Ideally I would like to be able to use az aks get-credentials
to produce a standalone config file without merging,
and then be able to append the new config file path to the KUBECONFIG environment variable.
Environment Summary
Windows-10-10.0.19044-SP0
Python 3.10.4
Installer: MSI
azure-cli 2.36.0
kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.5", GitCommit:"5c99e2ac2ff9a3c549d9ca665e7bc05a3e18f07e", GitTreeState:"clean", BuildDate:"2021-12-16T08:38:33Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"8211ae4d6757c3fedc53cd740d163ef65287276a", GitTreeState:"clean", BuildDate:"2022-03-31T20:28:03Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"}
Additional Context
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top GitHub Comments
Hi, thanks for your help. The --file option which you mentioned has helped me work around the issue, So I’m happy with the way things are for now.
@crowne Thanks for reaching out to us and sharing this feedback. We are looking into this issue. I will update this thread once I have more details on this.