Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

KeyError: 'client-certificate' #55

Closed
veerendra2 opened this issue Jul 4, 2016 · 6 comments
Closed

KeyError: 'client-certificate' #55

veerendra2 opened this issue Jul 4, 2016 · 6 comments

Comments

@veerendra2
Copy link

Hi,
I followed this https://pypi.python.org/pypi/pykube/ to query for all ready pods. I'm getting the KeyError: 'client-certificate' error.

>>> import operator
>>> import pykube
>>> api = pykube.HTTPClient(pykube.KubeConfig.from_file("/root/.kube/config"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/site-packages/pykube/http.py", line 33, in __init__
    self.session = self.build_session()
  File "/usr/local/lib/python3.5/site-packages/pykube/http.py", line 57, in build_session
    self.config.user["client-certificate"].filename(),
KeyError: 'client-certificate'

Im using Python 3.5

@parasit
Copy link

parasit commented Jul 18, 2016

Same error here, in python 2.7
Solution:
in http.py change line 55 from:
else:
to (same in current git version, but not in package pykube-0.12.0-py2.py3-none-any.whl)
elif "client-certificate" in self.config.user:

@tobegit3hub
Copy link

Same issue with python 2.7.6 when pip install pykube.

Thanks for @parasit and it works after python setup.py install with the latest source code.

I think this's resolved and you're welcome to close it 😃

@paultiplady
Copy link
Contributor

I think this is due to a change in the kube config schema, probably due to the 1.3.x kubectl client.

a006ed8 seems to put in a fix for the error.

Given that the current release is broken against kubectl v1.3 without this fix, can we get a new pypi release please?

@Chris-Dee
Copy link

When can we expect the next pypi release so that pip install pykube doesn't give this issue since its fixed in the source code?

@brosner
Copy link
Contributor

brosner commented Aug 23, 2016

Very soon. I need to review a couple more things before the release, but haven't had the time yet. I'll make that time today or tomorrow.

@brosner
Copy link
Contributor

brosner commented Aug 26, 2016

v0.13.0 has been tagged and released.

@brosner brosner closed this as completed Aug 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants