-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
az aks get-credentials
throws exception if ~/.kube/config does not contain the expected sections
#10812
Comments
az aks get-credentials
errors if ~/.kube/config does not contain the expected sectionsaz aks get-credentials
throws exception if ~/.kube/config does not contain the expected sections
Thanks for the feedback. I have routed to the appropriate team for follow up. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm |
We're looking into this issue - @palma21 fyi |
Any update on this issue? |
@maggiepint Any update on the issue? |
Also need update one this. |
Is there anything we can do to mitigate? |
Its gonna be 2 years now, no updates? |
ask service team should take a look |
@phealy Could you please let us know if you have any update on this issue ? |
@FooBarWidget Apologies for the late reply. We will get back to you once we have an update. @phealy Please let us know if you had a chance to look into this issue and provide the details on this github thread |
I don't know how to get this prioritized, it looks like people have already been complaining for ages... |
@amul047 Until a solution is provided, Could you please follow the workaround mentioned here and here and check if that helps ? In the meantime, I am tagging the AKS Service PM here to check if they can prioritize this. @Azure/aks-pm and @phealy Could you please look into this on priority and provide an update on this ? Awaiting your reply. |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
Describe the bug
az aks get-credentials
expects ~/.kube/config to contain aclusters
,users
andcontexts
section. If even one of them is missing, then the command will bail out with a Python KeyError exception.To Reproduce
Create ~/.kube/config with the following contents:
Then run:
Actual behavior
Expected behavior
I expect the command to succeed, like this:
Environment summary
I was able to reproduce this problem on two different environments.
Environment 1:
Environment 2:
Additional context
The problematic line is here:
azure-cli/src/azure-cli/azure/cli/command_modules/acs/custom.py
Line 1112 in 0d4a040
The code there attempts to check whether the config section exists, but does so in a wrong way. In Python,
foo[key]
raises an exception if the key doesn't exist, sofoo[key] is None
makes no sense here. You wantfoo.get(key) is None
which does not raise but returns None if the key does not exist.The text was updated successfully, but these errors were encountered: