Skip to content

Commit afd1d44

Browse files
committed
Update configuration.py
What type of PR is this? /kind bug What this PR does / why we need it: This PRs will read environment variables assigned for proxy and no_proxy.
1 parent d010f2e commit afd1d44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kubernetes/client/configuration.py

+6
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,15 @@ def __init__(self, host="http://localhost",
158158
"""
159159

160160
self.proxy = None
161+
if(os.getenv("HTTPS_PROXY")):self.proxy=os.getenv("HTTPS_PROXY")
162+
if(os.getenv("https_proxy")):self.proxy=os.getenv("https_proxy")
163+
if(os.getenv("HTTP_PROXY")):self.proxy=os.getenv("HTTP_PROXY")
164+
if(os.getenv("http_proxy")):self.proxy=os.getenv("http_proxy")
161165
"""Proxy URL
162166
"""
163167
self.no_proxy = None
168+
if(os.getenv("NO_PROXY")):self.no_proxy=os.getenv("NO_PROXY")
169+
if(os.getenv("no_proxy")):self.no_proxy=os.getenv("no_proxy")
164170
"""bypass proxy for host in the no_proxy list.
165171
"""
166172
self.proxy_headers = None

0 commit comments

Comments
 (0)