azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az aks get-credentials error with existing kubeconfig

Open sozercan opened this issue 6 years ago • 5 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az aks get-credentials

Errors:

'clusters'
Traceback (most recent call last):
python3.8/site-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 608, in execute
    raise ex
cli/core/commands/__init__.py, ln 666, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 659, in _run_job
    six.reraise(*sys.exc_info())
lib/python3.8/site-packages/six.py, ln 703, in reraise
    raise value
...
cli/command_modules/acs/custom.py, ln 3021, in _print_or_merge_credentials
    merge_kubernetes_configurations(path, temp_path, overwrite_existing, context_name)
cli/command_modules/acs/custom.py, ln 1180, in merge_kubernetes_configurations
    _handle_merge(existing, addition, 'clusters', replace)
cli/command_modules/acs/custom.py, ln 1115, in _handle_merge
    if existing[key] is None:
KeyError: 'clusters'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Have ~/.kube/config with following contents:
apiVersion: v1
kind: Config
preferences: {}
  • az aks get-credentials -n $RESOURCE_NAME -g $RESOURCE_GROUP

Expected Behavior

Get AKS kubeconfig

Environment Summary

Linux-5.0.0-1031-azure-x86_64-with-glibc2.2.5
Python 3.8.1
Shell: bash

azure-cli 2.0.81

Extensions:
aks-preview 0.4.28
azure-devops 0.17.0

Additional Context

sozercan avatar Feb 10 '20 22:02 sozercan

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm

ghost avatar Feb 11 '20 01:02 ghost

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm

ghost avatar Feb 11 '20 01:02 ghost

@sozercan , thanks for reporting, we are looking at this.

arrownj avatar Feb 11 '20 01:02 arrownj

Seems similar to https://github.com/Azure/azure-cli/issues/11881 and https://github.com/Azure/azure-cli/issues/12569

jessemillar avatar Mar 25 '20 17:03 jessemillar

Hello! Please try again with the latest Azure CLI version. Feel free to reopen an issue if it still doesn't work. https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Jen7714 avatar May 29 '20 16:05 Jen7714