Merge pull request #50841 from zjj2wry/kubectl-set-image-ignoring

Automatic merge from submit-queue (batch tested with PRs 50872, 51103, 51220, 51285, 50841)

Fix issue(#49695)kubectl set image deployment is ignoring --selector

**What this PR does / why we need it**:
closes #49695

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-08-25 10:10:13 -07:00 committed by GitHub
commit cb6f32e8ba

View File

@ -229,7 +229,10 @@ func (o *ImageOptions) Run() error {
}
if o.PrintObject != nil && (o.Local || o.DryRun) {
return o.PrintObject(o.Cmd, o.Local, o.Mapper, info.Object, o.Out)
if err := o.PrintObject(o.Cmd, o.Local, o.Mapper, info.Object, o.Out); err != nil {
return err
}
continue
}
// patch the change
@ -252,7 +255,10 @@ func (o *ImageOptions) Run() error {
info.Refresh(obj, true)
if len(o.Output) > 0 {
return o.PrintObject(o.Cmd, o.Local, o.Mapper, obj, o.Out)
if err := o.PrintObject(o.Cmd, o.Local, o.Mapper, obj, o.Out); err != nil {
return err
}
continue
}
cmdutil.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, o.DryRun, "image updated")
}