Skip to content

Commit

Permalink
Merge pull request #50841 from zjj2wry/kubectl-set-image-ignoring
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
Kubernetes Submit Queue committed Aug 25, 2017
2 parents 0a51ba1 + 1d7328a commit cb6f32e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/kubectl/cmd/set/set_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
}
Expand Down

0 comments on commit cb6f32e

Please sign in to comment.