Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #161 from ganchurin/issue-954
Browse files Browse the repository at this point in the history
Support false values in configuration file
  • Loading branch information
k8s-ci-robot committed Sep 24, 2019
2 parents f2ae80b + 6dec044 commit c700068
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/kube_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def safe_get(self, key):

def __getitem__(self, key):
v = self.safe_get(key)
if not v:
if v is None:
raise ConfigException(
'Invalid kube-config file. Expected key %s in %s'
% (key, self.name))
Expand Down
6 changes: 4 additions & 2 deletions config/kube_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,14 @@ class TestKubeConfigLoader(BaseTestCase):
"server": TEST_SSL_HOST,
"certificate-authority-data":
TEST_CERTIFICATE_AUTH_BASE64,
"insecure-skip-tls-verify": False,
}
},
{
"name": "no_ssl_verification",
"cluster": {
"server": TEST_SSL_HOST,
"insecure-skip-tls-verify": "true",
"insecure-skip-tls-verify": True,
}
},
],
Expand Down Expand Up @@ -1076,7 +1077,8 @@ def test_ssl(self):
token=BEARER_TOKEN_FORMAT % TEST_DATA_BASE64,
cert_file=self._create_temp_file(TEST_CLIENT_CERT),
key_file=self._create_temp_file(TEST_CLIENT_KEY),
ssl_ca_cert=self._create_temp_file(TEST_CERTIFICATE_AUTH)
ssl_ca_cert=self._create_temp_file(TEST_CERTIFICATE_AUTH),
verify_ssl=True
)
actual = FakeConfig()
KubeConfigLoader(
Expand Down

0 comments on commit c700068

Please sign in to comment.