mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
don't swallow bad request errors
This commit is contained in:
parent
46ed7713be
commit
f1d0835235
@ -17,7 +17,7 @@ limitations under the License.
|
||||
package resource
|
||||
|
||||
import (
|
||||
"github.com/golang/glog"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
@ -50,11 +50,10 @@ func (r *Selector) Visit(fn VisitorFunc) error {
|
||||
if err != nil {
|
||||
if errors.IsBadRequest(err) || errors.IsNotFound(err) {
|
||||
if r.Selector.Empty() {
|
||||
glog.V(2).Infof("Unable to list %q: %v", r.Mapping.Resource, err)
|
||||
return fmt.Errorf("Unable to list %q: %v", r.Mapping.Resource, err)
|
||||
} else {
|
||||
glog.V(2).Infof("Unable to find %q that match the selector %q: %v", r.Mapping.Resource, r.Selector, err)
|
||||
return fmt.Errorf("Unable to find %q that match the selector %q: %v", r.Mapping.Resource, r.Selector, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user