@@ -39,6 +39,8 @@ public struct KubernetesClientConfig: Sendable {
3939 public let timeout : HTTPClient . Configuration . Timeout
4040 /// The default redirect configuration for the underlying `HTTPCLient`.
4141 public let redirectConfiguration : HTTPClient . Configuration . RedirectConfiguration
42+ /// URL to the proxy to be used for all requests made by this client.
43+ public let proxyURL : URL ?
4244 /// Whether to request and decode gzipped responses from the API server.
4345 public let gzip : Bool
4446
@@ -50,6 +52,7 @@ public struct KubernetesClientConfig: Sendable {
5052 insecureSkipTLSVerify: Bool ,
5153 timeout: HTTPClient . Configuration . Timeout ,
5254 redirectConfiguration: HTTPClient . Configuration . RedirectConfiguration ,
55+ proxyURL: URL ? = nil ,
5356 gzip: Bool = false
5457 ) {
5558 self . masterURL = masterURL
@@ -59,6 +62,7 @@ public struct KubernetesClientConfig: Sendable {
5962 self . insecureSkipTLSVerify = insecureSkipTLSVerify
6063 self . timeout = timeout
6164 self . redirectConfiguration = redirectConfiguration
65+ self . proxyURL = proxyURL
6266 self . gzip = gzip
6367 }
6468}
@@ -209,7 +213,8 @@ internal struct StringConfigLoader: KubernetesClientConfigLoader {
209213 trustRoots: cluster. trustRoots ( logger: logger) ,
210214 insecureSkipTLSVerify: cluster. insecureSkipTLSVerify ?? true ,
211215 timeout: timeout,
212- redirectConfiguration: redirectConfiguration
216+ redirectConfiguration: redirectConfiguration,
217+ proxyURL: cluster. proxyURL. flatMap { URL ( string: $0) }
213218 )
214219 }
215220}
@@ -266,7 +271,8 @@ internal struct URLConfigLoader: KubernetesClientConfigLoader {
266271 trustRoots: cluster. trustRoots ( logger: logger) ,
267272 insecureSkipTLSVerify: cluster. insecureSkipTLSVerify ?? true ,
268273 timeout: timeout,
269- redirectConfiguration: redirectConfiguration
274+ redirectConfiguration: redirectConfiguration,
275+ proxyURL: cluster. proxyURL. flatMap { URL ( string: $0) }
270276 )
271277 }
272278}
@@ -336,7 +342,8 @@ internal struct ServiceAccountConfigLoader: KubernetesClientConfigLoader {
336342 trustRoots: trustRoots,
337343 insecureSkipTLSVerify: trustRoots == nil ,
338344 timeout: timeout,
339- redirectConfiguration: redirectConfiguration
345+ redirectConfiguration: redirectConfiguration,
346+ proxyURL: nil
340347 )
341348 }
342349
0 commit comments