@@ -1469,7 +1469,7 @@ def test_user_exec_auth(self, mock):
14691469 "token" : token
14701470 }
14711471 expected = FakeConfig (host = TEST_HOST , api_key = {
1472- "authorization " : BEARER_TOKEN_FORMAT % token })
1472+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
14731473 actual = FakeConfig ()
14741474 KubeConfigLoader (
14751475 config_dict = self .TEST_KUBE_CONFIG ,
@@ -1499,13 +1499,13 @@ def test_user_exec_auth_with_expiry(self, mock):
14991499 active_context = "exec_cred_user" ).load_and_set (fake_config )
15001500 # The kube config should use the first token returned from the
15011501 # exec provider.
1502- self .assertEqual (fake_config .api_key ["authorization " ],
1502+ self .assertEqual (fake_config .api_key ["BearerToken " ],
15031503 BEARER_TOKEN_FORMAT % expired_token )
15041504 # Should now be populated with a method to refresh expired tokens.
15051505 self .assertIsNotNone (fake_config .refresh_api_key_hook )
15061506 # Refresh the token; the kube config should be updated.
15071507 fake_config .refresh_api_key_hook (fake_config )
1508- self .assertEqual (fake_config .api_key ["authorization " ],
1508+ self .assertEqual (fake_config .api_key ["BearerToken " ],
15091509 BEARER_TOKEN_FORMAT % current_token )
15101510
15111511 @mock .patch ('kubernetes.config.kube_config.ExecProvider.run' )
@@ -1546,7 +1546,7 @@ def test_user_cmd_path(self):
15461546 return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
15471547 CommandTokenSource .token = mock .Mock (return_value = return_value )
15481548 expected = FakeConfig (api_key = {
1549- "authorization " : BEARER_TOKEN_FORMAT % token })
1549+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
15501550 actual = FakeConfig ()
15511551 KubeConfigLoader (
15521552 config_dict = self .TEST_KUBE_CONFIG ,
@@ -1559,7 +1559,7 @@ def test_user_cmd_path_empty(self):
15591559 return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
15601560 CommandTokenSource .token = mock .Mock (return_value = return_value )
15611561 expected = FakeConfig (api_key = {
1562- "authorization " : BEARER_TOKEN_FORMAT % token })
1562+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
15631563 actual = FakeConfig ()
15641564 self .expect_exception (lambda : KubeConfigLoader (
15651565 config_dict = self .TEST_KUBE_CONFIG ,
@@ -1573,7 +1573,7 @@ def test_user_cmd_path_with_scope(self):
15731573 return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
15741574 CommandTokenSource .token = mock .Mock (return_value = return_value )
15751575 expected = FakeConfig (api_key = {
1576- "authorization " : BEARER_TOKEN_FORMAT % token })
1576+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
15771577 actual = FakeConfig ()
15781578 self .expect_exception (lambda : KubeConfigLoader (
15791579 config_dict = self .TEST_KUBE_CONFIG ,
0 commit comments