mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-03-26 12:27:32 -04:00
don't swallow bad request errors
This commit is contained in:
parent
46ed7713be
commit
f1d0835235
1 changed files with 3 additions and 4 deletions
|
|
@ -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 a new issue