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

Loading configuration file fails when insecure-skip-tls-verify is false #954

Closed
ganchurin opened this issue Sep 15, 2019 · 10 comments
Closed
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@ganchurin
Copy link
Contributor

What happened:
Loading configuration file with config.load_kube_config() failed with the following error:

Traceback (most recent call last):
  File "TestK8Client.py", line 4, in <module>
    config.load_kube_config()
  File "/usr/local/lib/python2.7/site-packages/kubernetes/config/kube_config.py", line 649, in load_kube_config
    loader.load_and_set(config)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/config/kube_config.py", line 462, in load_and_set
    self._load_cluster_info()
  File "/usr/local/lib/python2.7/site-packages/kubernetes/config/kube_config.py", line 433, in _load_cluster_info
    self.verify_ssl = not self._cluster['insecure-skip-tls-verify']
  File "/usr/local/lib/python2.7/site-packages/kubernetes/config/kube_config.py", line 499, in __getitem__
    % (key, self.name))
kubernetes.config.config_exception.ConfigException: Invalid kube-config file. Expected key insecure-skip-tls-verify in [EDITED]/.kube/config/{'cluster': {'insecure-skip-tls-verify': False, 'certificate-authority-data': [EDITED], 'server': [EDITED]}, 'name': [EDITED]}/cluster

How to reproduce it:
The configuration file must include the following lines:

clusters:
- cluster:
    insecure-skip-tls-verify: false

Anything else we need to know?:
Java-client works fine with the same configuration file.

Environment:

  • Kubernetes version: v1.11.8
  • OS: MacOS 10.14.6
  • Python version: 2.7.13
  • Python client version: 10.0.1
@ganchurin ganchurin added the kind/bug Categorizes issue or PR as related to a bug. label Sep 15, 2019
@roycaihw
Copy link
Member

I can reproduce this issue with v10.0.1. Interestingly having insecure-skip-tls-verify: true works fine. I think there is something wrong in the getter

/good-first-issue

@k8s-ci-robot
Copy link
Contributor

@roycaihw:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

I can reproduce this issue with v10.0.1. Interestingly having insecure-skip-tls-verify: true works fine. I think there is something wrong in the getter

/good-first-issue

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.

@k8s-ci-robot k8s-ci-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Sep 18, 2019
@ganchurin
Copy link
Contributor Author

@roycaihw If there are no objections, I will work on this.

@micw523
Copy link
Contributor

micw523 commented Sep 18, 2019

Go for it - enjoy!

@ganchurin
Copy link
Contributor Author

/assign @ganchurin

@ganchurin
Copy link
Contributor Author

@roycaihw The corresponding PR was merged. Do I correctly understand that now I should propagate changes from python-base into python repository? Thanks!

@roycaihw
Copy link
Member

Yes, please open a PR to update the python-base submodule, e.g. #911

@ganchurin
Copy link
Contributor Author

Already done in #969

@micw523
Copy link
Contributor

micw523 commented Sep 25, 2019

/close
Thanks!

@k8s-ci-robot
Copy link
Contributor

@micw523: Closing this issue.

In response to this:

/close
Thanks!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants