The dynamic client example, kubernetes.client.ApiClient(...)
takes in the result of kubernetes.config.load_kube_config(...)
, which is empty
#2279
Labels
kind/documentation
Categorizes issue or PR as related to documentation.
Link to the issue (please include a link to the specific documentation or example):
Example where
client.ApiClient(configuration=config.load_kube_config())
is used:https://github.com/kubernetes-client/python/blob/master/examples/dynamic-client/configmap.py#L27
Link to where config function
load_kube_config()
does not return anything:https://github.com/kubernetes-client/python/blob/master/kubernetes/base/config/kube_config.py#L799
Description of the issue (please include outputs or screenshots if possible):
I would assume that when configuring an ApiClient, I should send the argument of the configuration object. However, since the
config.load_kube_config()
does not return anything, I feel that this example is wrong.I would assume I should do the following:
Since the
config.load_kube_config()
has this in the description:"Loads authentication and cluster information from kube-config file and stores them in kubernetes.client.configuration."
So that the
client.Configuration()
returned value is updated after being instantiated and thus can be passed to theapi_client.ApiClient(...)
function.Can anyone please correct me if I am wrong? I am unsure of what the correct way to get an ApiClient.
Thanks in advance!
The text was updated successfully, but these errors were encountered: