mirror of https://github.com/k3s-io/k3s
Fix a bug where IgnoreErrors was inverted.
Also make an error message a little more verbose.pull/6/head
parent
7ba41626e9
commit
ea3852ec69
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue