Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
loads kubeconfig only once #71117
What type of PR is this?
What this PR does / why we need it:
Currently a single kubeconfig file will be loaded several times, which should be parsed for only once.
Which issue(s) this PR fixes (optional, in
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
referenced this pull request
Nov 16, 2018
@liggitt @smarterclayton I don't think it is a good idea to load/parse the same config file again and again. That is time-consuming. And errors will occurr if we are changing the config file while the cli command is invoked.
This method is and will be only used by the command line. And only one such declaration is defined currently.
I know your concern about thread safe. But kubectl only got one such declaration.
To be clear, I'm fine with kubectl updating to use a method that explicitly loads only once (or with kubectl updating to load once itself and propagate the config to the places that need it, rather than calling this method multiple times)
This method is in an exported repo intended to be used by arbitrary command line tools. Searching only in the kubernetes/kubernetes repo does not indicate all usage.
@liggitt Okay, I got it. I will have another alternative method to keep this peristent config.
[APPROVALNOTIFIER] This PR is APPROVED
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing