devopsspiral / KubeLibrary

Kubernetes library for Robot Framework
MIT License
138 stars 37 forks source link

Add proxy settings for k8s client #122

Closed LissaGreense closed 1 year ago

LissaGreense commented 1 year ago

Hi!

I added proxy and noproxy settings to k8s client configuration. Both of them are fetched from environment variables.

m-wcislo commented 1 year ago

Hi, thanks for the PR, but from what I understand no_proxy is handled in the background see https://github.com/kubernetes-client/python/blob/5a96bbcbe21a552cc1f9cda13e0522fafb0dbac8/kubernetes/client/rest.py#L87 and https://github.com/psf/requests/blob/ac3be98b19f4d09c6a970b271a3ae30f3d0858f7/requests/utils.py#L774. So we don't really need to set it in our code, it will be taken from env vars. Could you verify this?

Also would be great to add small note to the README describing how to handle proxy.

LissaGreense commented 1 year ago

Hi Michal, Thank you for your fast response!

You are totally right! I didn't check this should_bypass_proxies function before. I just noticed that proxy hasn't been set, so I was convinced that no_proxy is also skipped :D

Let me fix this oversight :D

LissaGreense commented 1 year ago

@m-wcislo changes applied, waiting for review ;3

m-wcislo commented 1 year ago

Thanks! merging.