@@ -104,6 +104,8 @@ def _raise_exception(st):
104
104
TEST_CLIENT_CERT_BASE64 = _base64 (TEST_CLIENT_CERT )
105
105
TEST_TLS_SERVER_NAME = "kubernetes.io"
106
106
107
+ TEST_PROXY_URL = "http://localhost:8888"
108
+
107
109
TEST_OIDC_TOKEN = "test-oidc-token"
108
110
TEST_OIDC_INFO = "{\" name\" : \" test\" }"
109
111
TEST_OIDC_BASE = "." .join ([
@@ -551,6 +553,12 @@ class TestKubeConfigLoader(BaseTestCase):
551
553
"user" : "ssl-local-file"
552
554
}
553
555
},
556
+ {
557
+ "name" : "proxy" ,
558
+ "context" : {
559
+ "cluster" : "proxy" ,
560
+ }
561
+ },
554
562
{
555
563
"name" : "non_existing_user" ,
556
564
"context" : {
@@ -652,6 +660,12 @@ class TestKubeConfigLoader(BaseTestCase):
652
660
"tls-server-name" : TEST_TLS_SERVER_NAME ,
653
661
}
654
662
},
663
+ {
664
+ "name" : "proxy" ,
665
+ "cluster" : {
666
+ "proxy-url" : TEST_PROXY_URL ,
667
+ }
668
+ },
655
669
],
656
670
"users" : [
657
671
{
@@ -1284,6 +1298,16 @@ def test_tls_server_name(self):
1284
1298
active_context = "tls-server-name" ).load_and_set (actual )
1285
1299
self .assertEqual (expected , actual )
1286
1300
1301
+ def test_proxy_server (self ):
1302
+ expected = FakeConfig (
1303
+ proxy = TEST_PROXY_URL
1304
+ )
1305
+ actual = FakeConfig ()
1306
+ KubeConfigLoader (
1307
+ config_dict = self .TEST_KUBE_CONFIG ,
1308
+ active_context = "proxy" ).load_and_set (actual )
1309
+ self .assertEqual (expected , actual )
1310
+
1287
1311
def test_list_contexts (self ):
1288
1312
loader = KubeConfigLoader (
1289
1313
config_dict = self .TEST_KUBE_CONFIG ,
0 commit comments