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

This commit is contained in:
zhengjiajin 2017-08-17 19:56:25 +08:00
parent 4bfe9b1a56
commit 1d7328a290

View File

@ -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
@ -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")
}