Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@ganchurin

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

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