Merge pull request #64183 from WanLinghao/ctl_set_subject_fix

Automatic merge from submit-queue (batch tested with PRs 63232, 64257, 64183, 64266, 64134). 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 kubectl set subject --all option invalid bug

**What this PR does / why we need it**:
Fix the kubectl set subject --all option invalid bug and add test cases for it
**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 #64182

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2018-05-25 08:24:19 -07:00
committed by GitHub
2 changed files with 15 additions and 1 deletions

View File

@@ -262,7 +262,9 @@ func (o *SubjectOptions) Run(fn updateSubjects) error {
continue
}
return o.PrintObj(actual, o.Out)
if err := o.PrintObj(actual, o.Out); err != nil {
allErrs = append(allErrs, err)
}
}
return utilerrors.NewAggregate(allErrs)
}