File tree 1 file changed +10
-3
lines changed 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,14 @@ def get_client(
108
108
config_dict = config_dict , context = context or None , ** kwargs
109
109
)
110
110
)
111
- client_configuration = kwargs .get ("client_configuration" , kubernetes .client .Configuration ())
111
+
112
+ kwargs_copy = copy .deepcopy (kwargs )
113
+ if "client_configuration" in kwargs_copy :
114
+ client_configuration = kwargs_copy ["client_configuration" ]
115
+ del kwargs_copy ["client_configuration" ]
116
+ else :
117
+ client_configuration = kubernetes .client .Configuration ()
118
+
112
119
try :
113
120
# Ref: https://github.com/kubernetes-client/python/blob/v26.1.0/kubernetes/base/config/__init__.py
114
121
LOGGER .info ("Trying to get client via new_client_from_config" )
@@ -136,7 +143,7 @@ def get_client(
136
143
config_file = config_file ,
137
144
client_configuration = client_configuration ,
138
145
context = context or None ,
139
- ** kwargs ,
146
+ ** kwargs_copy ,
140
147
)
141
148
)
142
149
except MaxRetryError :
@@ -145,7 +152,7 @@ def get_client(
145
152
return kubernetes .dynamic .DynamicClient (
146
153
client = kubernetes .config .incluster_config .load_incluster_config (
147
154
client_configuration = client_configuration ,
148
- try_refresh_token = kwargs .get ("try_refresh_token" , True ),
155
+ try_refresh_token = kwargs_copy .get ("try_refresh_token" , True ),
149
156
)
150
157
)
151
158
You can’t perform that action at this time.
0 commit comments