✨ Add file provider for kubeconfig on the filesystem#53
Conversation
|
Welcome @ntnn! |
file provider for kubeconfig on the filesystemfile provider for kubeconfig on the filesystem
3e22a25 to
89dc416
Compare
|
|
|
@ntnn very cool provider! I know its a bit late for this idea (a lot of work has went into this PR!), but what if you added this functionality to the existing kubeconfig provider? Was thinking about maybe changing the kubeconfig provider options to use functions instead of config struct, then could be something like: p, err := kubeconfig.New(
kubeconfig.WithFileWatcher(fileWatchConfigs...),
kubeconfig.WithSecretWatcher(secretWatchConfigs...)
)What do you all think of that? |
|
Hi @FourFifthsCode ! Thanks! Imho most overlap is how to engange/disengage clusters and that is common between all providers. Personally I was hoping to keep providers simpler and to instead use a "meta" provider to use multiple providers. If a provider accepts multiple different sources the same problem arises and the clusterName would either have to be prefixed or just logging an error - which is what I currently do here in the file provider, but the file provider is only meant to make it possible to inject some kubeconfigs when working on a controller. I think a library with a generic provider that handles the common management of engaging/disengaging clusters would be great to simplify writing further providers. |
|
@ntnn yeah, I think what you said makes a lot of sense! Multi-provider and some more shared code sounds great! |
|
LGTM label has been added. DetailsGit tree hash: f439f19e5a7fe22505f0b026f1e52f7c1a0fe4b9 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik, ntnn The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adds a provider for kubeconfigs on the filesystem.
The name is a bit nondescript, but
kubeconfigis already used by the provider reading kubeconfigs from secrets.multicluster-runtime currently does not come with a way to pass or set a kubeconfig file for testing and this would fit that bill.