Browse code

Don't try to load plugin without name

This can happen when you have --config-only network
Such attempt will fail anyway and it will create 15s delay in container
startup

Signed-off-by: Pavel Matěja <pavel@verotel.cz>

Pavel Matěja authored on 2019/06/26 18:30:29
Showing 1 changed files
... ...
@@ -254,6 +254,9 @@ func get(name string) (*Plugin, error) {
254 254
 
255 255
 // Get returns the plugin given the specified name and requested implementation.
256 256
 func Get(name, imp string) (*Plugin, error) {
257
+	if name == "" {
258
+		return nil, errors.New("Unable to find plugin without name")
259
+	}
257 260
 	pl, err := get(name)
258 261
 	if err != nil {
259 262
 		return nil, err