@@ -1468,7 +1468,7 @@ def test_user_exec_auth(self, mock):
14681468 "token" : token
14691469 }
14701470 expected = FakeConfig (host = TEST_HOST , api_key = {
1471- "authorization " : BEARER_TOKEN_FORMAT % token })
1471+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
14721472 actual = FakeConfig ()
14731473 KubeConfigLoader (
14741474 config_dict = self .TEST_KUBE_CONFIG ,
@@ -1498,13 +1498,13 @@ def test_user_exec_auth_with_expiry(self, mock):
14981498 active_context = "exec_cred_user" ).load_and_set (fake_config )
14991499 # The kube config should use the first token returned from the
15001500 # exec provider.
1501- self .assertEqual (fake_config .api_key ["authorization " ],
1501+ self .assertEqual (fake_config .api_key ["BearerToken " ],
15021502 BEARER_TOKEN_FORMAT % expired_token )
15031503 # Should now be populated with a method to refresh expired tokens.
15041504 self .assertIsNotNone (fake_config .refresh_api_key_hook )
15051505 # Refresh the token; the kube config should be updated.
15061506 fake_config .refresh_api_key_hook (fake_config )
1507- self .assertEqual (fake_config .api_key ["authorization " ],
1507+ self .assertEqual (fake_config .api_key ["BearerToken " ],
15081508 BEARER_TOKEN_FORMAT % current_token )
15091509
15101510 @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