@@ -1342,7 +1342,7 @@ def test__get_kube_config_loader_for_yaml_file_persist(self):
1342
1342
actual = _get_kube_config_loader_for_yaml_file (config_file ,
1343
1343
persist_config = True )
1344
1344
self .assertTrue (callable (actual ._config_persister ))
1345
- self .assertEquals (actual ._config_persister .__name__ , "save_changes" )
1345
+ self .assertEqual (actual ._config_persister .__name__ , "save_changes" )
1346
1346
1347
1347
1348
1348
class TestKubernetesClientConfiguration (BaseTestCase ):
@@ -1517,6 +1517,28 @@ class TestKubeConfigMerger(BaseTestCase):
1517
1517
}
1518
1518
]
1519
1519
}
1520
+ #this PR https://github.com/kubernetes/kubernetes/pull/84503 changed the behaviour of kubectl,
1521
+ #If there is no users, the users field will be set to None.
1522
+ TEST_KUBE_CONFIG_PART6 = {
1523
+ "current-context" : "no_user" ,
1524
+ "contexts" : [
1525
+ {
1526
+ "name" : "no_user" ,
1527
+ "context" : {
1528
+ "cluster" : "default"
1529
+ }
1530
+ },
1531
+ ],
1532
+ "clusters" : [
1533
+ {
1534
+ "name" : "default" ,
1535
+ "cluster" : {
1536
+ "server" : TEST_HOST
1537
+ }
1538
+ },
1539
+ ],
1540
+ "users" : None
1541
+ }
1520
1542
1521
1543
def _create_multi_config (self ):
1522
1544
files = []
@@ -1525,7 +1547,8 @@ def _create_multi_config(self):
1525
1547
self .TEST_KUBE_CONFIG_PART2 ,
1526
1548
self .TEST_KUBE_CONFIG_PART3 ,
1527
1549
self .TEST_KUBE_CONFIG_PART4 ,
1528
- self .TEST_KUBE_CONFIG_PART5 ):
1550
+ self .TEST_KUBE_CONFIG_PART5 ,
1551
+ self .TEST_KUBE_CONFIG_PART6 ):
1529
1552
files .append (self ._create_temp_file (yaml .safe_dump (part )))
1530
1553
return ENV_KUBECONFIG_PATH_SEPARATOR .join (files )
1531
1554
0 commit comments