diff --git a/authorization/plugin.go b/authorization/plugin.go index ded43a9..1b65ac0 100644 --- a/authorization/plugin.go +++ b/authorization/plugin.go @@ -17,9 +17,14 @@ type Plugin interface { // NewPlugins constructs and initialize the authorization plugins based on plugin names func NewPlugins(names []string) []Plugin { - plugins := make([]Plugin, len(names)) - for i, name := range names { - plugins[i] = newAuthorizationPlugin(name) + plugins := []Plugin{} + pluginsMap := make(map[string]struct{}) + for _, name := range names { + if _, ok := pluginsMap[name]; ok { + continue + } + pluginsMap[name] = struct{}{} + plugins = append(plugins, newAuthorizationPlugin(name)) } return plugins } diff --git a/plugins/discovery.go b/plugins/discovery.go index d0ee274..5ea8db5 100644 --- a/plugins/discovery.go +++ b/plugins/discovery.go @@ -13,7 +13,7 @@ import ( var ( // ErrNotFound plugin not found - ErrNotFound = errors.New("Plugin not found") + ErrNotFound = errors.New("plugin not found") socketsPath = "/run/docker/plugins" specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} ) diff --git a/plugins/plugins.go b/plugins/plugins.go index f9e22d6..5ad4d89 100644 --- a/plugins/plugins.go +++ b/plugins/plugins.go @@ -96,7 +96,6 @@ func (p *Plugin) activateWithLock() error { return err } - logrus.Debugf("%s's manifest: %v", p.Name, m) p.Manifest = m for _, iface := range m.Implements {