@@ -81,8 +81,8 @@ def _get_api_version(dyn_client: DynamicClient, api_group: str, kind: str) -> st
81
81
def get_client (
82
82
config_file : str = "" ,
83
83
config_dict : Dict [str , Any ] | None = None ,
84
+ client_configuration : client .Configuration | None = None ,
84
85
context : str = "" ,
85
- proxy : Optional [str ] = "" ,
86
86
** kwargs : Any ,
87
87
) -> DynamicClient :
88
88
"""
@@ -99,8 +99,8 @@ def get_client(
99
99
Args:
100
100
config_file (str): path to a kubeconfig file.
101
101
config_dict (dict): dict with kubeconfig configuration.
102
+ client_configuration: The kubernetes.client.Configuration to set configs to.
102
103
context (str): name of the context to use.
103
- proxy (str): the URL to the proxy to be used for all requests made by this client.
104
104
105
105
Returns:
106
106
DynamicClient: a kubernetes client.
@@ -117,8 +117,8 @@ def get_client(
117
117
# If `KUBECONFIG` environment variable is set via code, the `KUBE_CONFIG_DEFAULT_LOCATION` will be None since
118
118
# is populated during import which comes before setting the variable in code.
119
119
config_file = config_file or os .environ .get ("KUBECONFIG" , "~/.kube/config" )
120
- proxy = proxy or os . environ . get ( "HTTPS_PROXY" ) or os . environ . get ( "HTTP_PROXY" )
121
- client_configuration = client . Configuration ( )
120
+ client_configuration = client_configuration or client . Configuration ( )
121
+ proxy = os . environ . get ( "HTTPS_PROXY" ) or os . environ . get ( "HTTP_PROXY" )
122
122
123
123
if proxy :
124
124
LOGGER .info (f"Trying to get client using proxy { proxy } " )
0 commit comments