Rename XDGDataPluginLoader to be uniform

This commit is contained in:
tcharding 2017-08-31 16:37:39 +10:00
parent 91eaa8a308
commit 0d464cac2f
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ func (f *ring2Factory) PluginLoader() plugins.PluginLoader {
return plugins.KubectlPluginsPathPluginLoader() return plugins.KubectlPluginsPathPluginLoader()
} }
return plugins.TolerantMultiPluginLoader{ return plugins.TolerantMultiPluginLoader{
plugins.XDGDataPluginLoader(), plugins.XDGDataDirsPluginLoader(),
plugins.UserDirPluginLoader(), plugins.UserDirPluginLoader(),
} }
} }

View File

@ -143,11 +143,11 @@ func KubectlPluginsPathPluginLoader() PluginLoader {
return PathFromEnvVarPluginLoader("KUBECTL_PLUGINS_PATH") 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 // directories specified by the XDG system directory structure spec in the
// XDG_DATA_DIRS env var, plus the "kubectl/plugins/" suffix. According to 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". // 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" envVarName := "XDG_DATA_DIRS"
if len(os.Getenv(envVarName)) > 0 { if len(os.Getenv(envVarName)) > 0 {
return PathFromEnvVarPluginLoader(envVarName, "kubectl", "plugins") return PathFromEnvVarPluginLoader(envVarName, "kubectl", "plugins")