mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Rename XDGDataPluginLoader to be uniform
This commit is contained in:
parent
91eaa8a308
commit
0d464cac2f
@ -183,7 +183,7 @@ func (f *ring2Factory) PluginLoader() plugins.PluginLoader {
|
||||
return plugins.KubectlPluginsPathPluginLoader()
|
||||
}
|
||||
return plugins.TolerantMultiPluginLoader{
|
||||
plugins.XDGDataPluginLoader(),
|
||||
plugins.XDGDataDirsPluginLoader(),
|
||||
plugins.UserDirPluginLoader(),
|
||||
}
|
||||
}
|
||||
|
@ -143,11 +143,11 @@ func KubectlPluginsPathPluginLoader() PluginLoader {
|
||||
return PathFromEnvVarPluginLoader("KUBECTL_PLUGINS_PATH")
|
||||
}
|
||||
|
||||
// XDGDataPluginLoader returns a PluginLoader that loads plugins from one or more
|
||||
// XDGDataDirsPluginLoader returns a PluginLoader that loads plugins from one or more
|
||||
// directories specified by the XDG system directory structure spec in the
|
||||
// XDG_DATA_DIRS env var, plus the "kubectl/plugins/" suffix. According to the
|
||||
// spec, if XDG_DATA_DIRS is not set it defaults to "/usr/local/share:/usr/share".
|
||||
func XDGDataPluginLoader() PluginLoader {
|
||||
func XDGDataDirsPluginLoader() PluginLoader {
|
||||
envVarName := "XDG_DATA_DIRS"
|
||||
if len(os.Getenv(envVarName)) > 0 {
|
||||
return PathFromEnvVarPluginLoader(envVarName, "kubectl", "plugins")
|
||||
|
Loading…
Reference in New Issue
Block a user