Merge pull request #161 from ganchurin/issue-954

Support false values in configuration file
This commit is contained in:
Kubernetes Prow Robot 2019-09-24 14:49:58 -07:00 committed by GitHub
commit c700068ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -503,7 +503,7 @@ class ConfigNode(object):
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))

View File

@ -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,
}
},
],
@ -1076,7 +1077,8 @@ class TestKubeConfigLoader(BaseTestCase):
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(