Fix a bug where IgnoreErrors was inverted.

Also make an error message a little more verbose.
pull/6/head
Brendan Burns 2015-05-13 14:16:24 +01:00
parent 7ba41626e9
commit ea3852ec69
2 changed files with 8 additions and 2 deletions

View File

@ -22,6 +22,8 @@ import (
"io"
"os"
"github.com/golang/glog"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl"
@ -161,6 +163,10 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
var ok bool
newRc, ok = obj.(*api.ReplicationController)
if !ok {
if _, kind, err := typer.ObjectVersionAndKind(obj); err == nil {
return cmdutil.UsageError(cmd, "%s contains a %s not a ReplicationController", filename, kind)
}
glog.V(4).Infof("Object %#v is not a ReplicationController", obj)
return cmdutil.UsageError(cmd, "%s does not specify a valid ReplicationController", filename)
}
}

View File

@ -217,7 +217,7 @@ func (v *PathVisitor) Visit(fn VisitorFunc) error {
}
info, err := v.Mapper.InfoForData(data, v.Path)
if err != nil {
if v.IgnoreErrors {
if !v.IgnoreErrors {
return err
}
glog.V(2).Infof("Unable to load file %q: %v", v.Path, err)
@ -280,7 +280,7 @@ func (v *DirectoryVisitor) Visit(fn VisitorFunc) error {
}
info, err := v.Mapper.InfoForData(data, path)
if err != nil {
if v.IgnoreErrors {
if !v.IgnoreErrors {
return err
}
glog.V(2).Infof("Unable to load file %q: %v", path, err)