Skip to content

Commit 2b5e27d

Browse files
committed
run scripts/insert_proxy_config.sh
1 parent 02b6daf commit 2b5e27d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

kubernetes/client/configuration.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import six
2222
from six.moves import http_client as httplib
2323
from kubernetes.client.exceptions import ApiValueError
24+
import os
2425

2526

2627
JSON_SCHEMA_VALIDATION_KEYWORDS = {
@@ -207,6 +208,14 @@ def __init__(self, host=None,
207208
"""Proxy URL
208209
"""
209210
self.no_proxy = None
211+
# Load proxy from environment variables (if set)
212+
if os.getenv("HTTPS_PROXY"): self.proxy = os.getenv("HTTPS_PROXY")
213+
if os.getenv("https_proxy"): self.proxy = os.getenv("https_proxy")
214+
if os.getenv("HTTP_PROXY"): self.proxy = os.getenv("HTTP_PROXY")
215+
if os.getenv("http_proxy"): self.proxy = os.getenv("http_proxy")
216+
# Load no_proxy from environment variables (if set)
217+
if os.getenv("NO_PROXY"): self.no_proxy = os.getenv("NO_PROXY")
218+
if os.getenv("no_proxy"): self.no_proxy = os.getenv("no_proxy")
210219
"""bypass proxy for host in the no_proxy list.
211220
"""
212221
self.proxy_headers = None

0 commit comments

Comments
 (0)