-
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] az aks get-credentials
: Fix the command error when KUBECONFIG is empty
#23000
Conversation
AKS |
logger.info("The default path '%s' is replaced by '%s' defined in KUBECONFIG.", path, kubeconfig_path) | ||
path = kubeconfig_path | ||
else: | ||
logger.warning("Invalid path '%s' defined in KUBECONFIG.", kubeconfig_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why just print the warning log instead of raising an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I think there are some usage scenarios where the user has multiple kubeconfig files, then sets the environment variable KUBECONFIG
to point to a specific kubeconfig file to perform some operatations, and sometimes leaves KUBECONFIG
empty to operate with the kubeconfig located in the default path (~/.kube/config
).
I hope this change is that when the user sets KUBECONFIG
to be empty, the kubeconfig of the cluster can also be successfully downloaded to the default location.
More discussions are welcome:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense!
Related command
az aks get-credentials
Description
When KUBECONFIG is empty, keep using the default storage path (
~/.kube/config
) and output warning-level logs; otherwise, use the path in KUBECONFIG to replace the default storage path and output info-level logs. Thanks to @fseldow for reporting this bug.Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a
: Make some customer-facing breaking change[Component Name 2]
az command b
: Add some customer-facing featureThis 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.
I adhere to the Error Handling Guidelines.