Skip to content
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

[bug] init command fails if kube-config does not contain the selected cluster #109

Open
derbl4ck opened this issue Nov 28, 2023 · 0 comments

Comments

@derbl4ck
Copy link

Describe the bug
The command az iot ops init fails if kube-config does not contain the selected cluster.

To Reproduce
Steps to reproduce the behavior:

  1. Person A creates a new arc-enabled AKS Edge Essentials system
  2. Person B wants to install Azure IoT Operations on this existing system
  3. Since Person B never used the system, it cannot be found within kube-config
  4. See error

Expected behavior
Instead of the python error, there should be some user friendly error message with an example on how to get the credentials of the cluster. This example could be filled with all the parameters which are provided anyway.

Screenshots

 az iot ops init --subscription xxxxx -g rg-xxxxx --cluster xxxxx-aksee001 --kv-id /subscriptions/xxxxx/resourceGroups/rg-xxxxx/providers/Microsoft.KeyVault/vaults/kv-xxxxx --no-deploy
Command group 'iot ops' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The command failed with an unexpected error. Here is the traceback:
Invalid kube-config file. No configuration found.
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "C:\Users\xxxxx\.azure\cliextensions\azure-iot-ops\azext_edge\edge\commands_edge.py", line 128, in init
    load_config_context(context_name=context_name)
  File "C:\Users\xxxxx\.azure\cliextensions\azure-iot-ops\azext_edge\edge\providers\base.py", line 41, in load_config_context
    config.load_kube_config(context=context_name)
  File "C:\Users\xxxxx\.azure\cliextensions\azure-iot-ops\kubernetes\config\kube_config.py", line 815, in load_kube_config
    loader = _get_kube_config_loader(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xxxxx\.azure\cliextensions\azure-iot-ops\kubernetes\config\kube_config.py", line 772, in _get_kube_config_loader
    raise ConfigException(
kubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found.

Environment (please complete the following information):

  • OS: Windows 10 Enterprise
  • Shell: powershell
  • Az CLI version: 2.54.0
  • IoT extension version: 0.1.0b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant