code: func (c *FakeMiddlewares) List(opts v1.ListOptions) (result *v1alpha1.MiddlewareList, err error) {
  	obj, err := c.Fake.
  		Invokes(testing.NewListAction(middlewaresResource, middlewaresKind, c.ns, opts), &v1alpha1.MiddlewareList{})
  
  	if obj == nil {
  		return nil, err
  	}
  
  	label, _, _ := testing.ExtractFromListOptions(opts)
  	if label == nil {
  		label = labels.Everything()
  	}
  	list := &v1alpha1.MiddlewareList{ListMeta: obj.(*v1alpha1.MiddlewareList).ListMeta}
  	for _, item := range obj.(*v1alpha1.MiddlewareList).Items {
  		if label.Matches(labels.Set(item.Labels)) {
  			list.Items = append(list.Items, item)
  		}
  	}
  	return list, err
  }
docs: // List takes label and field selectors, and returns the list of Middlewares that match those selectors.