@@ -1469,7 +1469,7 @@ def test_user_exec_auth(self, mock):
1469
1469
"token" : token
1470
1470
}
1471
1471
expected = FakeConfig (host = TEST_HOST , api_key = {
1472
- "authorization " : BEARER_TOKEN_FORMAT % token })
1472
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1473
1473
actual = FakeConfig ()
1474
1474
KubeConfigLoader (
1475
1475
config_dict = self .TEST_KUBE_CONFIG ,
@@ -1499,13 +1499,13 @@ def test_user_exec_auth_with_expiry(self, mock):
1499
1499
active_context = "exec_cred_user" ).load_and_set (fake_config )
1500
1500
# The kube config should use the first token returned from the
1501
1501
# exec provider.
1502
- self .assertEqual (fake_config .api_key ["authorization " ],
1502
+ self .assertEqual (fake_config .api_key ["BearerToken " ],
1503
1503
BEARER_TOKEN_FORMAT % expired_token )
1504
1504
# Should now be populated with a method to refresh expired tokens.
1505
1505
self .assertIsNotNone (fake_config .refresh_api_key_hook )
1506
1506
# Refresh the token; the kube config should be updated.
1507
1507
fake_config .refresh_api_key_hook (fake_config )
1508
- self .assertEqual (fake_config .api_key ["authorization " ],
1508
+ self .assertEqual (fake_config .api_key ["BearerToken " ],
1509
1509
BEARER_TOKEN_FORMAT % current_token )
1510
1510
1511
1511
@mock .patch ('kubernetes.config.kube_config.ExecProvider.run' )
@@ -1546,7 +1546,7 @@ def test_user_cmd_path(self):
1546
1546
return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
1547
1547
CommandTokenSource .token = mock .Mock (return_value = return_value )
1548
1548
expected = FakeConfig (api_key = {
1549
- "authorization " : BEARER_TOKEN_FORMAT % token })
1549
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1550
1550
actual = FakeConfig ()
1551
1551
KubeConfigLoader (
1552
1552
config_dict = self .TEST_KUBE_CONFIG ,
@@ -1559,7 +1559,7 @@ def test_user_cmd_path_empty(self):
1559
1559
return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
1560
1560
CommandTokenSource .token = mock .Mock (return_value = return_value )
1561
1561
expected = FakeConfig (api_key = {
1562
- "authorization " : BEARER_TOKEN_FORMAT % token })
1562
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1563
1563
actual = FakeConfig ()
1564
1564
self .expect_exception (lambda : KubeConfigLoader (
1565
1565
config_dict = self .TEST_KUBE_CONFIG ,
@@ -1573,7 +1573,7 @@ def test_user_cmd_path_with_scope(self):
1573
1573
return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
1574
1574
CommandTokenSource .token = mock .Mock (return_value = return_value )
1575
1575
expected = FakeConfig (api_key = {
1576
- "authorization " : BEARER_TOKEN_FORMAT % token })
1576
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1577
1577
actual = FakeConfig ()
1578
1578
self .expect_exception (lambda : KubeConfigLoader (
1579
1579
config_dict = self .TEST_KUBE_CONFIG ,
0 commit comments