Skip to content

Commit aa63891

Browse files
committed
Check for proxy conflicts in client_configuration and environment variable
1 parent 148d834 commit aa63891

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ocp_resources/resource.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ def get_client(
123123
raise ValueError(
124124
"Proxy configuration is enabled but neither HTTPS_PROXY nor HTTP_PROXY environment variables are set."
125125
)
126+
if client_configuration.proxy and client_configuration.proxy != proxy:
127+
raise ValueError(
128+
f"Conflicting proxy settings: client_configuration.proxy={client_configuration.proxy}, "
129+
f"but the environment variable 'OPENSHIFT_PYTHON_WRAPPER_CLIENT_USE_PROXY' defines proxy as {proxy}."
130+
)
126131
client_configuration.proxy = proxy
127132

128133
return kubernetes.dynamic.DynamicClient(

0 commit comments

Comments
 (0)