Skip to content

Commit

Permalink
fix issue(#49695)kubectl set image deployment is ignoring --selector
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengjiajin committed Aug 17, 2017
1 parent 4bfe9b1 commit 1d7328a
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 @@ -227,7 +227,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 @@ -250,7 +253,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 1d7328a

Please sign in to comment.