Skip to content

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

Description

@ganchurin

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

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug.
    on Sep 15, 2019
  2. roycaihw commented on Sep 18, 2019

    @roycaihw
    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

  3. k8s-ci-robot commented on Sep 18, 2019

    @k8s-ci-robot
    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.

    Details

    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.

  4. added
    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Sep 18, 2019
  5. ganchurin commented on Sep 18, 2019

    @ganchurin
    ContributorAuthor

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

  6. micw523 commented on Sep 18, 2019

    @micw523
    Contributor

    Go for it - enjoy!

  7. ganchurin commented on Sep 18, 2019

    @ganchurin
    ContributorAuthor

    /assign @ganchurin

  8. ganchurin commented on Sep 24, 2019

    @ganchurin
    ContributorAuthor

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

  9. roycaihw commented on Sep 24, 2019

    @roycaihw
    Member

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

  10. ganchurin commented on Sep 25, 2019

    @ganchurin
    ContributorAuthor

    Already done in #969

  11. micw523 commented on Sep 25, 2019

    @micw523
    Contributor

    /close
    Thanks!

  12. k8s-ci-robot commented on Sep 25, 2019

    @k8s-ci-robot
    Contributor

    @micw523: Closing this issue.

    Details

    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

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions