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

Commit

Permalink
change test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ACXLM committed Jun 24, 2020
1 parent 3ff79da commit 5565d32
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions config/kube_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ def test__get_kube_config_loader_for_yaml_file_persist(self):
actual = _get_kube_config_loader_for_yaml_file(config_file,
persist_config=True)
self.assertTrue(callable(actual._config_persister))
self.assertEquals(actual._config_persister.__name__, "save_changes")
self.assertEqual(actual._config_persister.__name__, "save_changes")


class TestKubernetesClientConfiguration(BaseTestCase):
Expand Down Expand Up @@ -1517,6 +1517,28 @@ class TestKubeConfigMerger(BaseTestCase):
}
]
}
# This PR https://github.com/kubernetes/kubernetes/pull/84503 changed the behaviour of kubectl,
# If there is no users, the users field will be set to None.
TEST_KUBE_CONFIG_PART6 = {
"current-context": "no_user",
"contexts": [
{
"name": "no_user",
"context": {
"cluster": "default"
}
},
],
"clusters": [
{
"name": "default",
"cluster": {
"server": TEST_HOST
}
},
],
"users": None
}

def _create_multi_config(self):
files = []
Expand All @@ -1525,7 +1547,8 @@ def _create_multi_config(self):
self.TEST_KUBE_CONFIG_PART2,
self.TEST_KUBE_CONFIG_PART3,
self.TEST_KUBE_CONFIG_PART4,
self.TEST_KUBE_CONFIG_PART5):
self.TEST_KUBE_CONFIG_PART5,
self.TEST_KUBE_CONFIG_PART6):
files.append(self._create_temp_file(yaml.safe_dump(part)))
return ENV_KUBECONFIG_PATH_SEPARATOR.join(files)

Expand Down

0 comments on commit 5565d32

Please sign in to comment.