-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Added kubernetes.leaderelection in packages list to fix import error #1370
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
Conversation
…ed 'kubernetes.leaderelection' error To reproduce: Make sure to create a file outside of checked out python repo directory. $ cat hello_k8s.py import kubernetes kubernetes.config.load_kube_config() k8s = kubernetes.client.CoreV1Api() print("Listing pods with their IPs:") ret = k8s.list_pod_for_all_namespaces(watch=False) for i in ret.items: print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name)) python hello_k8s.py Traceback (most recent call last): File "hello_k8s.py", line 1, in <module> import kubernetes File "<frozen zipimport>", line 259, in load_module File "anaconda3/lib/python3.8/site-packages/kubernetes-17.0.0_snapshot-py3.8.egg/kubernetes/__init__.py", line 25, in <module> ModuleNotFoundError: No module named 'kubernetes.leaderelection'
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soumitrak, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
test_portforward_raw failed, it is not related to this change. How can I rerun the tests to see if it succeeds in next run? |
close and reopen this pr to trigger another ci run |
/close |
@yliaog: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@yliaog: Reopened this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thanks! |
Added kubernetes.leaderelection in packages list to fix No module named 'kubernetes.leaderelection' error
To reproduce: Make sure to create a file outside of checked out python repo directory.
$ cat hello_k8s.py
import kubernetes
kubernetes.config.load_kube_config()
k8s = kubernetes.client.CoreV1Api()
print("Listing pods with their IPs:")
ret = k8s.list_pod_for_all_namespaces(watch=False)
for i in ret.items:
print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name))
python hello_k8s.py
Traceback (most recent call last):
File "hello_k8s.py", line 1, in
import kubernetes
File "", line 259, in load_module
File "anaconda3/lib/python3.8/site-packages/kubernetes-17.0.0_snapshot-py3.8.egg/kubernetes/init.py", line 25, in
ModuleNotFoundError: No module named 'kubernetes.leaderelection'