Merge pull request #64242 from WanLinghao/ctl_print_fix

Automatic merge from submit-queue (batch tested with PRs 63417, 64249, 64242, 64128, 64275). 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>.

fix bugs that break processing when printing errors occur in kubectl

**What this PR does / why we need it**:
The process should continue when error happens, this patch fix the problem
**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
```
This commit is contained in:
Kubernetes Submit Queue
2018-05-24 20:49:15 -07:00
committed by GitHub
7 changed files with 21 additions and 13 deletions

View File

@@ -277,7 +277,7 @@ func (o *SetResourcesOptions) Run() error {
if o.Local || o.DryRun {
if err := o.PrintObj(info.Object, o.Out); err != nil {
return err
allErrs = append(allErrs, err)
}
continue
}
@@ -289,7 +289,7 @@ func (o *SetResourcesOptions) Run() error {
}
if err := o.PrintObj(actual, o.Out); err != nil {
return err
allErrs = append(allErrs, err)
}
}
return utilerrors.NewAggregate(allErrs)