code: func (s *Store) lookup(name string, mode int) (volume.Driver, error) {
  	if name == "" {
  		return nil, errdefs.InvalidParameter(errors.New("driver name cannot be empty"))
  	}
  	s.driverLock.Lock(name)
  	defer s.driverLock.Unlock(name)
  
  	s.mu.Lock()
  	ext, ok := s.extensions[name]
  	s.mu.Unlock()
  	if ok {
  		return ext, nil
  	}
  	if s.pluginGetter != nil {
  		p, err := s.pluginGetter.Get(name, extName, mode)
  		if err != nil {
  			return nil, errors.Wrap(err, "error looking up volume plugin "+name)
  		}
  
  		d, err := makePluginAdapter(p)
  		if err != nil {
  			return nil, errors.Wrap(err, "error making plugin client")
  		}
  		if err := validateDriver(d); err != nil {
  			if mode > 0 {
  				// Undo any reference count changes from the initial `Get`
  				if _, err := s.pluginGetter.Get(name, extName, mode*-1); err != nil {
  					logrus.WithError(err).WithField("action", "validate-driver").WithField("plugin", name).Error("error releasing reference to plugin")
  				}
  			}
  			return nil, err
  		}
  
  		if p.IsV1() {
  			s.mu.Lock()
  			s.extensions[name] = d
  			s.mu.Unlock()
  		}
  		return d, nil
  	}
  	return nil, driverNotFoundError(name)
  }
docs: // lookup returns the driver associated with the given name. If a
  // driver with the given name has not been registered it checks if
  // there is a VolumeDriver plugin available with the given name.