Commit d6ce7190 authored by Chao Xu's avatar Chao Xu

Merge pull request #13732 from hurf/ac_doc

Doc fix for admission/plugin.go
parents 183c6e2e 7b4f91c4
...@@ -37,7 +37,7 @@ var ( ...@@ -37,7 +37,7 @@ var (
plugins = make(map[string]Factory) plugins = make(map[string]Factory)
) )
// GetPlugins enumerates the // GetPlugins enumerates the names of all registered plugins.
func GetPlugins() []string { func GetPlugins() []string {
pluginsMutex.Lock() pluginsMutex.Lock()
defer pluginsMutex.Unlock() defer pluginsMutex.Unlock()
...@@ -48,7 +48,7 @@ func GetPlugins() []string { ...@@ -48,7 +48,7 @@ func GetPlugins() []string {
return keys return keys
} }
// RegisterPlugin registers a plugin Factory by name. This // RegisterPlugin registers a plugin Factory by name. This
// is expected to happen during app startup. // is expected to happen during app startup.
func RegisterPlugin(name string, plugin Factory) { func RegisterPlugin(name string, plugin Factory) {
pluginsMutex.Lock() pluginsMutex.Lock()
...@@ -61,11 +61,10 @@ func RegisterPlugin(name string, plugin Factory) { ...@@ -61,11 +61,10 @@ func RegisterPlugin(name string, plugin Factory) {
plugins[name] = plugin plugins[name] = plugin
} }
// GetPlugin creates an instance of the named plugin, or nil if // GetPlugin creates an instance of the named plugin, or nil if the name is not
// the name is not known. The error return is only used if the named provider // known. The error is returned only when the named provider was known but failed
// was known but failed to initialize. The config parameter specifies the // to initialize. The config parameter specifies the io.Reader handler of the
// io.Reader handler of the configuration file for the cloud provider, or nil // configuration file for the cloud provider, or nil for no configuration.
// for no configuration.
func GetPlugin(name string, client client.Interface, config io.Reader) (Interface, error) { func GetPlugin(name string, client client.Interface, config io.Reader) (Interface, error) {
pluginsMutex.Lock() pluginsMutex.Lock()
defer pluginsMutex.Unlock() defer pluginsMutex.Unlock()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment