Merge pull request #54989 from wackxu/reterr

Automatic merge from submit-queue (batch tested with PRs 52367, 53363, 54989, 54872, 54643). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

should check and return err when visit failure

**What this PR does / why we need it**:

should check and return err when visit failure

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-11-02 12:59:18 -07:00 committed by GitHub
commit 5f73021e25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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).