Skip to content

Make InClusterConfigLoader support explicit config parameter #194

Closed
@GlassOfWhiskey

Description

@GlassOfWhiskey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions