Bladeren bron

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 6 jaren geleden
bovenliggende
commit
ee09f5a4af
1 gewijzigde bestanden met toevoegingen van 3 en 0 verwijderingen
  1. 3 0
      pkg/plugins/plugins.go

+ 3 - 0
pkg/plugins/plugins.go

@@ -254,6 +254,9 @@ func get(name string) (*Plugin, error) {
 
 
 // Get returns the plugin given the specified name and requested implementation.
 // Get returns the plugin given the specified name and requested implementation.
 func Get(name, imp string) (*Plugin, error) {
 func Get(name, imp string) (*Plugin, error) {
+	if name == "" {
+		return nil, errors.New("Unable to find plugin without name")
+	}
 	pl, err := get(name)
 	pl, err := get(name)
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err