mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +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
|
package resource
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/golang/glog"
|
"fmt"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api/errors"
|
"k8s.io/kubernetes/pkg/api/errors"
|
||||||
"k8s.io/kubernetes/pkg/api/meta"
|
"k8s.io/kubernetes/pkg/api/meta"
|
||||||
@ -50,11 +50,10 @@ func (r *Selector) Visit(fn VisitorFunc) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.IsBadRequest(err) || errors.IsNotFound(err) {
|
if errors.IsBadRequest(err) || errors.IsNotFound(err) {
|
||||||
if r.Selector.Empty() {
|
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 {
|
} 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
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user