projectatomic / atomicapp

[UNMAINTAINED] This is the reference implementation of the Nulecule container application Specification: Atomic App
102 stars 71 forks source link

atomicapp errors on missing user for k8s configuration #771

Open cdrage opened 8 years ago

cdrage commented 8 years ago

If supplied with this:

apiVersion: v1
clusters:
- cluster:
    server: http://localhost:8080
  name: dev
contexts:
- context:
    cluster: dev
    user: ""
  name: dev
current-context: dev
kind: Config
preferences: {}
users: []

With a blank user, atomicapp errors out:


Traceback (most recent call last):

  File "/opt/atomicapp/atomicapp/cli/main.py", line 130, in cli_func_exec

    cli_func(cli_func_args)

  File "/opt/atomicapp/atomicapp/cli/main.py", line 84, in cli_run

    nm.run(**argdict)

  File "/opt/atomicapp/atomicapp/nulecule/main.py", line 322, in run

    self.nulecule.run(cli_provider, dryrun)

  File "/opt/atomicapp/atomicapp/nulecule/base.py", line 205, in run

    component.run(provider_key, dryrun)

  File "/opt/atomicapp/atomicapp/nulecule/base.py", line 339, in run

    provider.init()

  File "/opt/atomicapp/atomicapp/providers/kubernetes.py", line 107, in init

    self.api = Client(KubeConfig.from_file(default_config_loc), "kubernetes")

  File "/opt/atomicapp/atomicapp/providers/lib/kubeshift/client.py", line 42, in __init__

    self.connection = KubeKubernetesClient(config)

  File "/opt/atomicapp/atomicapp/providers/lib/kubeshift/kubernetes.py", line 43, in __init__

    self.api = KubeBase(config)

  File "/opt/atomicapp/atomicapp/providers/lib/kubeshift/kubebase.py", line 83, in __init__

    self.user = self._users()[kubeconfig_user]

KeyError: u''