should check and return err when visit failure

pull/6/head
wackxu 2017-11-02 20:15:34 +08:00
parent 40212c17cd
commit 7a05ecd046
1 changed files with 4 additions and 1 deletions

View File

@ -233,7 +233,7 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
if timeout == 0 {
timeout = kubectl.Timeout
}
r.Visit(func(info *resource.Info, err error) error {
err = r.Visit(func(info *resource.Info, err error) error {
if err != nil {
return err
}
@ -245,6 +245,9 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
return true, nil
})
})
if err != nil {
return err
}
r = f.NewBuilder().
Unstructured(f.UnstructuredClientForMapping, mapper, typer).