Skip to content

Make InClusterConfigLoader support explicit config parameter #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GlassOfWhiskey opened this issue Apr 3, 2022 · 2 comments · Fixed by #196
Closed

Make InClusterConfigLoader support explicit config parameter #194

GlassOfWhiskey opened this issue Apr 3, 2022 · 2 comments · Fixed by #196
Labels
enhancement New feature or request

Comments

@GlassOfWhiskey
Copy link
Contributor

GlassOfWhiskey commented Apr 3, 2022

Configuration related classes KubeConfigLoader and InClusterConfigLoader behave differently in the load_and_set method. The first one requires an external Configuration object, which can be either automatically generated or passed explicitly by the user in the load_kube_config function.
Conversely, the InClusterConfigLoader only supports the automatically generated default Configuration object. This does not support situations in which a Python client must connect to both the local Kubernetes cluster and a remote cluster in the same run.
A simple fix would be to harmonize the behaviour of the two objects by passing an explicit config object to the load_and_set method of the InClusterConfigLoader class and a client_configuration object to the load_incluster_config function. Backward compatibility can be ensured by defaulting those parameters to None and keeping the actual behaviour in case of None inputs.

@GlassOfWhiskey
Copy link
Contributor Author

I have no problems in providing a PR also for this issue if needed.

@tomplus tomplus added the enhancement New feature or request label Apr 3, 2022
@tomplus
Copy link
Owner

tomplus commented Apr 3, 2022

Thanks for reporting this. Your proposed fix looks good to me. It'd be fantastic if you could work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants