Skip to content

Commit 541ff71

Browse files
authored
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. Which issue(s) this PR fixes: Fixes kubernetes-client#2321 Special notes for your reviewer: Unit test is added kubernetes\base\stream\ws_client_test.py Does this PR introduce a user-facing change? None Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: None
1 parent d010f2e commit 541ff71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kubernetes/client/configuration.py

Lines changed: 6 additions & 0 deletions
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)