[AKS] CLI should tolerate empty kubeconfig#14914
Conversation
|
Not sure what the right component prefix is supposed to be here... |
| if not addition.get(key, False): | ||
| return | ||
| if existing[key] is None: | ||
| if not existing.get(key): |
There was a problem hiding this comment.
existing[key] == None / 0 / [] / "" / {} will all trigger this condition, is this the expected behavior ?
There was a problem hiding this comment.
I'm not an expert on what "valid" vs "invalid" kubeconfigs look like, so I don't know for sure.
I think at the very least a missing key should be treated the same as an empty key (before, a missing key triggered an exception).
I was matching the line above on 1214 which was was doing the same thing (not checking specifically for == False or something.
Looking further on in the code, if we don't overwrite None / 0 / "" the code below will blow up I think as we'll try to iterate over it assuming that it's a dict.
|
Add @zqingqing1 @tjprescott to review. |
|
@arrownj @zqingqing1 - is there more I need to do here? If not can we merge this? |
Description
Fix bug #13846
Testing Guide
Run
az aks get-credentials --resource-group <rg> --name <name>on an AKS cluster while your local kubeconfig is empty:This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.